Solution needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Thulasiraman
    New Member
    • Jun 2007
    • 2

    Solution needed

    Hi All,
    I am New to this Group,I need a solution for a problem,Waiting for ur reply..
    My Problem is

    I have a column , Which has Names starts with alphabets, Now i want to generate Auto id fields according to the first letter of the name

    Suppose a Name starts with Arun My Id field should Be A001
    Like wise If its B it shuld be B001

    How can i solve this issue.
  • tifoso
    New Member
    • Apr 2007
    • 41

    #2
    You can do it with a store procedure and loop thru your records sorten alphabeticaly or if you want to be cool via trigger just make sure it is well written
    as it might be a performance issue if not clean


    pseudo code goes like this:

    cusor select f1m f2 from table order by f1

    loop thru cursor and insert appropiately changing your counter when first character changes

    deallocate cursor


    smile


    Ciao

    Comment

    Working...