Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 large insert script

Author  Topic 

sconard
Starting Member

18 Posts

Posted - 2011-06-13 : 11:36:19
I need to run a script that generates a table and inserts 300k records. sqlcmd truncates results to around 50k. How do I run this large script that inserts 300k rows? I am using microsoft sql server 2008

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2011-06-13 : 12:07:44
what is the source of the data ? csv table in access, xml?

If you don't have the passion to help people, you have no passion
Go to Top of Page

sconard
Starting Member

18 Posts

Posted - 2011-06-13 : 13:07:56
Original data is from dbase5 that has been run through converter that creates the following. If I break the script into chunks of 20k rows of inserts, the script runs without issue.


if exists ( select * from sys.tables where name = N'jobexp')
DROP TABLE [jobexp];
CREATE TABLE [jobexp] (
[JOBEXPNO] Integer,
[JOBSIDE] Integer,
[JOBJN] Char(2),
[JOBKEY] Char(23),
[JOBPAYEE] Char(40),
[JOBPROJ] Char(12),
[JOBLEV2] Char(6),
[JOBLEV3] Char(6),
[JOBTYPE] Char(1),
[JOBSTATUS] Char(2),
[JOBCOST] Numeric(11,3),
[JOBQTY] Numeric(8,2),
[JOBBAMT] Numeric(10,2),
[JOBLASTP] Char(12),
[JOBINV] Char(12),
[JOBCTL] Integer,
[JOBNOTES] Text,
[JOBJNARC] Bit,
[JOBVENID] Char(8),
[JOBPJINV] Char(12),
[JOBACCOUNT] Char(12),
[JOBCATGY] Char(6),
[JOBCHECK] Integer);
insert into [jobexp] values(73,1,'JX','','REPRODUCTION','011835','RE','R','R','R',14.400,1.00,3.00,'DEBBIE','',0,'',null,'353360','','','T',0);
insert into [jobexp] values(74,1,'JX','','REPRODUCTION SPECIALTIES','011835','RE','R','R','R',57.600,1.00,57.60,'CARLA','',0,'',null,'353410','','','',0);

etc...
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2011-06-13 : 15:51:16
will this be a one time ingest or continuous?

If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -