October 3, 2003 at 9:23 am
when i do insert into...select, there is a non-identity type unique column on receiving table. i have been using newid() to generate values ( like insert into tbl_receving...select newid(), col1...from tbl_from)
newid() values are not so efficient regards to space, so wondering what are my other options ( cannot alter receving table structure ). Help in creating a script is appreciated, thank you.
October 3, 2003 at 10:51 am
One option might be to declare the table up front with your identity column. Then use INSERT INTO <table> ( < all but ident column> )
SELECT from source
Granted, you need to know the structure up front - but I have found very few occasions to use select into
Guarddata-
October 3, 2003 at 11:12 am
I would have a 2 step approach, Insert all the records into a temp table. Alter the table to include the identity column and insert the records into the table form the temp table
October 3, 2003 at 11:56 am
quote:
I would have a 2 step approach, Insert all the records into a temp table. Alter the table to include the identity column and insert the records into the table form the temp table
October 3, 2003 at 11:58 am
that's what actually i am doing now - using a temp table 2 step process, but wondering if there is a one-step process, thx
October 6, 2003 at 1:33 am
do you have the bandwidth to use DTS packages? If yes you could create the sequence required before loading the data into the destination table.
Thanks
Lucas
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply