dbTalk Databases Forums  

BULK INSERT limit on number of columns

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss BULK INSERT limit on number of columns in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dave Merrill
 
Posts: n/a

Default BULK INSERT limit on number of columns - 12-17-2003 , 11:48 PM






Does anyone know if there's a hard limit to the number of columns you can
import with BULK INSERT? Maybe 255? Any change between SQL 7 and current?

Trying for 335, I get an error with what I believe is a correct fmt file;
says "invalid column number", but doesn't say which.

Thanks,

D



Reply With Quote
  #2  
Old   
lindawie
 
Posts: n/a

Default Re: BULK INSERT limit on number of columns - 12-18-2003 , 12:13 AM






Dave,

Quote:
Does anyone know if there's a hard limit to the number of columns
you can import with BULK INSERT? Maybe 255? Any change between
SQL 7 and current?

Trying for 335, I get an error with what I believe is a correct
fmt file; says "invalid column number", but doesn't say which.
I believe the limit is 1024, same as the maximum number of columns
per table. I have used format files with many more columns than 335.

The this error message is most likely accurate. Make sure you have
not repeated a column number in the first field. This is a popular
copy and paste error.

Sometimes it helps to open a format file is Excel to check the line
numbering. Another trick I use to check accuracy is to create a new
format file with bcp and compare it to the offending one to find
descrepancies in the numbering.

Linda



Reply With Quote
  #3  
Old   
Dave Merrill
 
Posts: n/a

Default Re: BULK INSERT limit on number of columns - 12-18-2003 , 07:31 AM



Thanks for the info; it made me look more closely at the fmt file. It had
originally been generated mechanically, so I thought it was almost certainly
correct. However, I'd tweazed it a bit with find and replace, and had
monkeyed it up a bit. Once I fixed those errors it worked fine.

Next problem is that it's timing out when I run this code from enterprise
mgr with the full data I need to import (22 Megs or so). I haven't run into
this issue before for some reason, working primarily via ColdFusion,
including with very large imports. ColdFusion must be managing this for me,
but it doesn't apply here. How can I change the timeout setting, ideally for
this request only, but globally if that's not possible? How do I find out
the current setting to restore it when I'm done?

Thanks again,

Dave


"lindawie" <lindawie (AT) my-deja (DOT) com> wrote

Quote:
Dave,

Does anyone know if there's a hard limit to the number of columns
you can import with BULK INSERT? Maybe 255? Any change between
SQL 7 and current?

Trying for 335, I get an error with what I believe is a correct
fmt file; says "invalid column number", but doesn't say which.

I believe the limit is 1024, same as the maximum number of columns
per table. I have used format files with many more columns than 335.

The this error message is most likely accurate. Make sure you have
not repeated a column number in the first field. This is a popular
copy and paste error.

Sometimes it helps to open a format file is Excel to check the line
numbering. Another trick I use to check accuracy is to create a new
format file with bcp and compare it to the offending one to find
descrepancies in the numbering.

Linda




Reply With Quote
  #4  
Old   
lindawie
 
Posts: n/a

Default Re: BULK INSERT limit on number of columns - 12-18-2003 , 09:38 AM



Dave Merrill,

Quote:
Next problem is that it's timing out when I run this code from
enterprise mgr with the full data I need to import (22 Megs or
so). I haven't run into this issue before for some reason,
working primarily via ColdFusion, including with very large
imports. ColdFusion must be managing this for me, but it doesn't
apply here. How can I change the timeout setting, ideally for
this request only, but globally if that's not possible? How do I
find out the current setting to restore it when I'm done?
You can change the query timeout setting in the Server Property
dialog, Connections tab. However, Enterprise Manager is not a good
tool for this sort of thing. Use Query Analyzer to execute code
instead.

Linda



Reply With Quote
  #5  
Old   
Dave Merrill
 
Posts: n/a

Default Re: BULK INSERT limit on number of columns - 12-18-2003 , 09:01 PM



Quote:
Next problem is that it's timing out when I run this code from
enterprise mgr with the full data I need to import (22 Megs or
so). I haven't run into this issue before for some reason,
working primarily via ColdFusion, including with very large
imports. ColdFusion must be managing this for me, but it doesn't
apply here. How can I change the timeout setting, ideally for
this request only, but globally if that's not possible? How do I
find out the current setting to restore it when I'm done?

You can change the query timeout setting in the Server Property
dialog, Connections tab. However, Enterprise Manager is not a good
tool for this sort of thing. Use Query Analyzer to execute code
instead.

Linda

Thanks figured that out, not problem. Couldn't find a relevant timeout
setting in enterprise; I looked before writing. No biggie though, fine in
analyzer.

Dave




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.