Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
kneel
Starting Member
36 Posts |
Posted - 2008-09-24 : 07:55:26
|
| Hello All,How can I write insert query/sp to add profile id like P001,P002 dynamically into table which will be primary key in SQL server 2000.if anyone has an idea, please let me know.Thanks in advance.--kneel |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-24 : 07:57:28
|
| how many values you need to insert at a time? what determines number of values to be inserted? |
 |
|
|
kneel
Starting Member
36 Posts |
Posted - 2008-09-24 : 08:04:25
|
| one only--kneel |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-24 : 08:10:29
|
quote: Originally posted by kneel one only--kneel
then just use INSERT INTO Table (ProfileID,fields,...)SELECT 'P001',... |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2008-09-24 : 08:41:53
|
| Easier way is to create an Identity column, and then have a calculated column that concatenates it with your prefix.Boycotted Beijing Olympics 2008 |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
|
|
|