Seriously, this is RIDICULOUS | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Seriously, this is RIDICULOUS

So, I am trying to import some delimited text files into SQL Server 2005. I have a table called ‘test’ with 1 column ‘comments’ create table test ( [comments] [varchar](70) ); I have a .txt file with 5 rows of data:
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz123456789
test2
test3
test4
test5 When I try to import this file into SQL Server 2005, it barfs. Why does it barf? Because SQL Server "thinks" that all varchar fields should have a length of 50, and SQL Server is not intelligent enough to look at the definition of the table and figure out that the length should be 70. Why is this? I cannot automate this. Why do I have to manually tell SSIS that this field should have a length of 70? SQL Server 2005 is 10 steps backward from SQL Server 2000. WTF??? Am I going crazy?? Archer
quote:Originally posted by bagmanIII Because SQL Server "thinks" that all varchar fields should have a length of 50, and SQL Server is not intelligent enough to look at the definition of the table and figure out that the length should be 70. Archer

I don’t really get your point but I was able to insert into the table without any error. Why don’t you use varchar(max) for comments column? Thanks,
DilliGrg
Does the table already exist (from previous import attempts) and your new import attempt is simply APPENDING? drop the table and try to re-import. it’s all good
I’ve had something similar. Contrary to DTS, in SSIS you have to define the text file, not just the table. It seems redundant to me too. But it will work if you define the text file.
]]>