Data Loading

Last Post 02 May 2010 04:16 PM by gunneyk. 2 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
kkarthik1979
New Member
New Member

--
29 Jul 2009 03:21 PM
I've close to 60 databases - each of them have tables with similar schemas. I would like to create just one table, and load the data from all tables to this one. All these databases are in one server only. What is the better and fastest way to do it?? Cursors, While Loop??? any suggestions? Please let me know.

Thanks in advance !!
Lee
New Member
New Member

--
30 Apr 2010 10:15 AM
INSERT SELECT with the WITH (TABLOCK) to get minimal logging and a lot of speed. Check it out on Books Online for more info.
gunneyk
New Member
New Member

--
02 May 2010 04:16 PM
You need to be in Bulk Logged or Simple recovery mode along with a host of other requirements to get a minimally logged load. Just using TABLOCK doesnt cut it. You can find out more details here ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_4deptrbl/html/bd1dac6b-6ef8-4735-ad4e-67bb42dc4f66.htm
Havign said that I think dropping all indexes and using Insert INTO SELECT and recreating the indexes in SIMPLE or BULK LOGGED recovery mode is probably the easiest.


Acceptable Use Policy
---