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 |
vk18
Posting Yak Master
146 Posts |
Posted - 2007-06-23 : 00:59:43
|
Hi,I am trying to Insert Max(RecordID) into the Table Kit_Infowhen i do the bulk insert from ST_Info into Kit_info using DTS. I know in Sql Server2000 there is a Identity Column which increments the RecordID, But for some reasons i should not use that. When i use the below query it is incrementing all the records with the same number. I want the RecordID in the Incrementing Order. Any Idea.? Thx INSERT INTO Kit_Info(media,recdate,RecordID) SELECT media,recdate,(select max(RecordID) + 1 from Kit_Info) FROM ST_InfoAs it is a bulk insert this query is not working. any idea.?Thx |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-23 : 01:18:39
|
TryINSERT INTO Kit_Info(media,recdate) SELECT media,recdate FROM ST_InfoDeclare @i intselect @i=max(RecordID) from Kit_Info Update Kit_infoset RecordId=@i,@i=@i+1MadhivananFailing to plan is Planning to fail |
 |
|
vk18
Posting Yak Master
146 Posts |
Posted - 2007-06-26 : 12:44:05
|
quote: Originally posted by madhivanan TryINSERT INTO Kit_Info(media,recdate) SELECT media,recdate FROM ST_InfoDeclare @i intselect @i=max(RecordID) from Kit_Info Update Kit_infoset RecordId=@i,@i=@i+1MadhivananFailing to plan is Planning to fail
Hi,I tried this,It is incrementing all Recid's. I just want to increment the last imported one's. Thx |
 |
|
|
|
|
|
|