SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 bulk insert problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pascal_jimi
Posting Yak Master

Azerbaijan
150 Posts

Posted - 12/30/2013 :  02:21:20  Show Profile  Visit pascal_jimi's Homepage  Reply with Quote
hi
text file so

005283 BAK? BA? S?HIYY? IDAR?SI 2 100 00010130606 1000 000 000 000 000 1000 1
020200*AVIRTEL MMC 2 000 3803710 -200 000 000 000 000 -200 0



1--- I created a table


CREATE TABLE idare_abune
(Test char(6), Test1 char(60), Test2 char(2), Test3 char(4),
Test4 char(26), Test5 char(11), Test6 char(12),
Test7 char(8), Test8 char(7), Test9 char(7),
Test10 char(11), Test11 char(5), Test12 char(7),Test13 char(3))



2--------- I created a fmt file

exec xp_cmdshell
'bcp ats342.dbo.idare_abune format nul -S XIRDALAN-SERVER -f "c:\temp\idare_abun.fmt" -c -T'


3----------I changed fmt file

'\t' to ''


4----

BULK INSERT idare_abune
FROM 'C:\Documents and Settings\?????????????\??????? ????\obrabotka\OBOROTKA-092.list.txt'
WITH
(
FORMATFILE = 'c:\temp\idare_abun.fmt'
)


-----------------

i get error


-------
The statement has been terminated.

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

waterduck
Aged Yak Warrior

Malaysia
964 Posts

Posted - 12/30/2013 :  03:24:43  Show Profile  Reply with Quote
the number of column from the text file and table seem different
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000