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 2005 Forums
 Transact-SQL (2005)
 BULK INSERT issue

Author  Topic 

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2009-04-02 : 06:11:29
hi

I have data in .txt file with a '`|`' delimeter no format file used. it works perfectly fine in most of the cases in few cases where i have data like 'Test - Bulk' it gives error.


'Test Bulk' works fine
'Test - Bulk' it gives error.

the other paramters used are

WITH(FIELDTERMINATOR = '`|`',ROWTERMINATOR = '\n',DATAFILETYPE = 'widechar'

i cannot avoid "-" in my data and i have many different files no creating format file is not viable option.

Thanks



========================================
Project Manager who loves to code.
===============
Ask to your self before u ask someone

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2009-04-02 : 07:23:19
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=6255&whichpage=2
Go to Top of Page

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2009-04-02 : 07:37:51
thanks darkdusky,

I have gone thru complete thread no way i found any thing which talk about handling hyphens.





========================================
Project Manager who loves to code.
===============
Ask to your self before u ask someone
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-02 : 07:46:17
Why are you using three characters for column delimiter, instead of just using pipe character?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2009-04-02 : 08:13:11
I hope that shd not cause any problem. my data can contain pipe character so i am using a combination of charaters.
and all this time it worked fine.. untill i hit this

'Test Bulk' works fine
'Test-Bulk' works fine
'Test - Bulk' it gives error.


========================================
Project Manager who loves to code.
===============
Ask to your self before u ask someone
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-02 : 08:14:42
Email me the testfile.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2009-04-02 : 10:09:09
thanks Peso got it resolved.. was some thign else nothign to do with "-"

========================================
Project Manager who loves to code.
===============
Ask to your self before u ask someone
Go to Top of Page
   

- Advertisement -