how to write this Query ??
-
Hello All, I have a table with some Columns. I am inserting the records in this table by bulk insert query. The problem is that in the last column the data is inserted by name with FIELDTERMINATOR $. I just need to wirte a query by which I can remove this $ and just have name in that column. Any suggestions... Thanks in advance...
-
Hello All, I have a table with some Columns. I am inserting the records in this table by bulk insert query. The problem is that in the last column the data is inserted by name with FIELDTERMINATOR $. I just need to wirte a query by which I can remove this $ and just have name in that column. Any suggestions... Thanks in advance...
To this and your other question below. What is the row delimiter used in the file? If it's a newline, just add BULK INSERT dbo.tb_DEMO FROM 'C:\DEMO08Q1.TXT' WITH ( FIELDTERMINATOR ='$' ROWTERMINATOR = '$\n' ) BTW, does your file have only 1 row?
-
To this and your other question below. What is the row delimiter used in the file? If it's a newline, just add BULK INSERT dbo.tb_DEMO FROM 'C:\DEMO08Q1.TXT' WITH ( FIELDTERMINATOR ='$' ROWTERMINATOR = '$\n' ) BTW, does your file have only 1 row?
hello SimulationofSai, Thanks for the reply. Its working now. File contains almost 104411 rows. I did this : BULK INSERT dbo.tb_DEMO FROM 'C:\DEMO08Q1.TXT' WITH ( FIRSTROW = 2 ,FIELDTERMINATOR ='$' ,ROWTERMINATOR = '$\n' ) FirstRow = 2 solved my first problem and ur suggestion helped me to solve my 2nd problem. Thanks again... :)