Home All Groups Group Topic Archive Search About
Author
10 Feb 2006 5:17 PM
dew
How would I copy x amount of records, at the same time changing one of the
fields?
I can't copy the records as is, because of unique constraints, and I can't
leave the field that needs to be changed blank, also because nulls are not
allowed.  So how would I do it in one swoop?

Author
10 Feb 2006 5:23 PM
Barry
Use a staging table.

Copy the rows from TableA to a staging table. Change the data that
needs changing and then copy the rows in to Table B

Barry
Are all your drivers up to date? click for free checkup

Author
10 Feb 2006 7:00 PM
dew
Ah.  That works great, thanks!


Show quoteHide quote
"Barry" <barry.ocon***@singers.co.im> wrote in message
news:1139592215.572339.195290@g47g2000cwa.googlegroups.com...
> Use a staging table.
>
> Copy the rows from TableA to a staging table. Change the data that
> needs changing and then copy the rows in to Table B
>
> Barry
>
Author
10 Feb 2006 5:24 PM
Barry
Not sure about doing in one swoop but you could use a staging table.

Copy the rows from TableA to a staging table. Change the data that
needs changing and then copy the rows in to Table B

Barry
Author
10 Feb 2006 5:29 PM
Trey Walpole
what does it need to be changed to? and from? and what data type is it?
x amount of records? do you mean e.g., "copy 50 rows from a to b" or
"copy however many rows match my criteria from a to b"?

Please post DDL, including constraints etc., sample data and desired
results. Otherwise, all answers can be considered nothing more than guesses.

dew wrote:
Show quoteHide quote
> How would I copy x amount of records, at the same time changing one of the
> fields?
> I can't copy the records as is, because of unique constraints, and I can't
> leave the field that needs to be changed blank, also because nulls are not
> allowed.  So how would I do it in one swoop?
>
>

Bookmark and Share