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
 General SQL Server Forums
 New to SQL Server Programming
 bulk insert error

Author  Topic 

pascal_jimi
Posting Yak Master

167 Posts

Posted - 2014-01-15 : 05:36:06
hi friends want to do an bulk insert but get an error

Message 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.

here's the sql code

CREATE TABLE myTable99
(Test char(7), Test1 char(60), Test2 char(2), Test3 char(4),
Test4 char(4), Test5 char(25), Test6 char(11),
Test7 char(7), Test8 char(10), Test9 char(8),
Test10 char(10), Test11 char(10), Test12 char(7)
)



exec xp_cmdshell
'bcp DB_BOOKS.dbo.myTable99 format nul -S XIRDALAN-SERVER -f "c:\temp\myTable.fmt" -c -T'
select @@servername



this is fmt file


8.0
13
1 SQLCHAR 0 7 "" 1 Test Cyrillic_General_CI_AS
2 SQLCHAR 0 60 "" 2 Test1 Cyrillic_General_CI_AS
3 SQLCHAR 0 2 "" 3 Test2 Cyrillic_General_CI_AS
4 SQLCHAR 0 4 "" 4 Test3 Cyrillic_General_CI_AS
5 SQLCHAR 0 4 "" 5 Test4 Cyrillic_General_CI_AS
6 SQLCHAR 0 25 "" 6 Test5 Cyrillic_General_CI_AS
7 SQLCHAR 0 11 "" 7 Test6 Cyrillic_General_CI_AS
8 SQLCHAR 0 7 "" 8 Test7 Cyrillic_General_CI_AS
9 SQLCHAR 0 10 "" 9 Test8 Cyrillic_General_CI_AS
10 SQLCHAR 0 8 "" 10 Test9 Cyrillic_General_CI_AS
11 SQLCHAR 0 10 "" 11 Test10 Cyrillic_General_CI_AS
12 SQLCHAR 0 10 "" 12 Test11 Cyrillic_General_CI_AS
13 SQLCHAR 0 7 "\r\n" 13 Test12 Cyrillic_General_CI_AS



BULK INSERT myTable99
FROM 'C:\abs040123.txt'
WITH
(
FORMATFILE = 'c:\temp\myTable.fmt'
)


i get error

Message 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.


text file in this adress


https://docs.google.com/file/d/0B3LMe3WzKs3TZ21sRGhSTGFZeDQ/edit

http://sql-az.tr.gg/

pascal_jimi
Posting Yak Master

167 Posts

Posted - 2014-01-16 : 02:04:56
my friends are the same PROFESSIONALS

nobody can import this file?

http://sql-az.tr.gg/
Go to Top of Page
   

- Advertisement -