Hi All,
I have a problem,
I need to copy a large amount of data from one table and insert it into another table.
The design of the destination table is exactly the same as the source table except for the fact that it has one extra field.
Can I copy; in a single SQL statement; all rows in one table (that match given criteria) into another table allowing for the extra field?What's "a large amount of data"?
INSERT INTO myNewTable99(Col1, Col2, ect)
SELECT Col1,Col2,ect
FROM myOldTable99
WHERE ...
You could also create a view, bcp the data out then in...|||OK - i see how that copies the old data across but what about the additional field?|||Oh and by a large amount of data i'm talking about 10,000 rows of data from a table of around 20 fields of various types.|||OK - i see how that copies the old data across but what about the additional field?
Just leave it out of the col list...unless it's not null
Then either add a 0 or '' or '12/31/9999' depending on the data type in the SELECT
and 10,000 is nothing...
No comments:
Post a Comment