Bulk Insert
-
Hello All, I am developing a Windows Service in which I download some data from net. Data which I download is in text file. Text file contains the data and column name of the Table and is seperated by $. Something like this : C1$C2$C3$C4$C5$C6$C7$C8$C9$C10$C11$C12$C13$C14$C15$C16$C17$C18$C19$C20$C21$C22$C23$ 5476771$6638853$I$$5476771-2$$$20071003$DIR$$$$$$N$$$20071003$OT$$N$N$UNITED STATES$ 5476957$6689344$I$$5476957-7$20070927$$20071002$DIR$$$59$YR$F$N$142$LBS$20070930$OT$$N$Y$UNITED STATES$ I worte the following Query for Bulk Insert:
BULK INSERT dbo.tb_DEMO
FROM 'C:\DEMO08Q1.TXT'
WITH
(
FIELDTERMINATOR ='$'
)I am facing 2 problems in this: 1: I have to delete the column Names from the file and then fire this query. 2: If I delete the column Names then it works but in the last column the data is inserted with $. example: UNITED STATES$ Please help me.... Thanks in Advance.