Sep 3, 2004 #1 manicleek Technical User Jun 16, 2004 143 GB I have a db table and I'm wanting to add a new column 'marref' and in that I want to put a reference number. i.e. mar00001 mar00002 mar00003 etc... obviously I don't want to type each one individually, so can anyone tell me the sql code I will need
I have a db table and I'm wanting to add a new column 'marref' and in that I want to put a reference number. i.e. mar00001 mar00002 mar00003 etc... obviously I don't want to type each one individually, so can anyone tell me the sql code I will need
Sep 3, 2004 #2 r937 Technical User Jun 30, 2002 8,847 CA you'd be better off asking this in the forum for the dbms you're using i'm not sure ANSI SQL even allows for autonumbers best bet is to create an autonumber column, then declare a view on the table so that you get the prefix attached to the numebrs rudy http://r937.com/ SQL Consulting Upvote 0 Downvote
you'd be better off asking this in the forum for the dbms you're using i'm not sure ANSI SQL even allows for autonumbers best bet is to create an autonumber column, then declare a view on the table so that you get the prefix attached to the numebrs rudy http://r937.com/ SQL Consulting
Sep 4, 2004 #3 swampBoogie Programmer Jan 6, 2003 1,660 SE i'm not sure ANSI SQL even allows for autonumbers Click to expand... It does. There is support for both sequences and generators. Upvote 0 Downvote
i'm not sure ANSI SQL even allows for autonumbers Click to expand... It does. There is support for both sequences and generators.