June 15, 2005 at 7:29 am
I need to update a table in database A from database B with the same/similiar columns in the tables. Would this be better accomplished through DTS or just a simple script like:
insert into table A (column1, column2, ...)
select from (column1, column2, ...) from table B where ....
Are there any advantages/disadvantages to using one over the other? I will be doing this just once...hopefully!
Any help or assistance would be greatly appreciated!
June 15, 2005 at 7:35 am
DTS will append all the data, or truncate/reinsert all.
I like the control of the insert statement.
June 15, 2005 at 7:50 am
Within the same server we can do everything with a query analyzer as well as DTS Package(transfer data between databases, append, truncate, delete check previous rows). Also original poster says it is most likely one time task.
It would be easier to write SQL statements and execute. I will go with SQL if it is one time task.
I would like know which is faster.
Regards,
gova
June 15, 2005 at 10:35 am
Would I have to connect to both databases in the script, say:
Use dbo.databaseA
insert into table A (column1, column2, ...)
Use DatabaseB
select from (column1, column2, ...) from table B where ....
Or how would I go about doing that via the script option?
June 15, 2005 at 11:29 am
(from db1)
Insert into [db1.]dbo.TableName (col1, col2)
Select Col1, Col2 from db2.dbo.TableName2
June 16, 2005 at 1:38 am
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply