December 5, 2007 at 2:17 pm
I have these two statements. Both work. My question is if I wanted to import using statement 2 how would I batch it ?
--Truncate Table
TRUNCATE TABLE dbo.Test
--Insert Data Into Table
BULK INSERT dbo.Test FROM 'D:\Test.txt' WITH (BATCHSIZE = 100000,FIELDTERMINATOR = ',',ROWTERMINATOR = '')
INSERT tb_Test EXECUTE MASTER..xp_cmdShell 'Type \\M012edr\daily$\INFILES\TEST.TXT'
nb: are there any scripts or articles to insert,update,delete data in batches for large tables
December 5, 2007 at 7:07 pm
in second option batch is not possible.....
BTW....did u tied second statement....it should fail cause all data will go in first row/ first column only....over 8k bites it will fail
Prakash Heda
Lead DBA Team - www.sqlfeatures.com
Video sessions on Performance Tuning and SQL 2012 HA
December 5, 2007 at 10:09 pm
Besides, I believe that the first script will probably blow the doors off the second script.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 5, 2007 at 10:16 pm
BTW....did u tied second statement....it should fail cause all data will go in first row/ first column only....over 8k bites it will fail
Prakash... did YOU try it? Your statement is not correct... it will NOT go to first row/ first column only... 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
December 5, 2007 at 10:22 pm
Ray...
If, for some reason, you elect to go with the second form, you may also want to check out the following command as a possible source for your Insert...
EXECUTE MASTER.dbo.xp_ReadErrorLog 1, '\\M012edr\daily$\INFILES\TEST.TXT'
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply