I am using SQL server 2000 and VB6 for my project. In its one module I have to import a raw data from a text file having row terminator = \n and field terminator = TAB. I am using following SQL to import data.
Code:
BULK INSERT billing_master.dbo.test
FROM 'c:\abc.dat' --Raw data source file
WITH (FIELDTERMINATOR = '\t',ROWTERMINATOR = '\n', FIRE_TRIGGERS)
The problem is in raw data source file. There is an extra "ENTER/Line Break" at the end of last row of data. Means last row contains 2 x \n.
Due to this my above SQL enable to import data into DB. But when I manually delete last one "ENTER/Line Break" (by oppeing file in notepad and removing it), my query works fine.
Can anyone give me a solution either in SQL or in VB6, also the attached image explain the my questions graphically.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.