March 9, 2009 at 8:47 pm
what is the fastest method to copy data from one table to another table in a different database but on the same instance?
a simple select * into db1.dbo.tablea from db2.dbo.tablea ???
March 9, 2009 at 9:03 pm
Yes ....
Although if table exists then you have to do
INSERT INTO OtherDB.dbo.TableName
SELECT ColList, ...
FROM CurrentDB.dbo.TableName
Mohit K. Gupta, MCITP: Database Administrator (2005), My Blog, Twitter: @SQLCAN[/url].
Microsoft FTE - SQL Server PFE
* Some time its the search that counts, not the finding...
* I didn't think so, but if I was wrong, I was wrong. I'd rather do something, and make a mistake than be frightened and be doing nothing. :smooooth:[/font]
March 10, 2009 at 10:34 am
To make it faster you can also make use of the non-logged or minimally logged operations to avoid writing into the transaction log if your business task allows that. Read this discussion:
Non-logged insert... select
reply by Chad Boyd
He explains that Select.. INTO is non-logged and also you can use OPENROWSET with BULK option (in SQL 2005).
Check the prerequisites for the minimal logging at:
http://msdn.microsoft.com/en-us/library/ms190422.aspx
Regards,Yelena Varsha
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply