September 26, 2007 at 6:41 am
Hi All
In my application i m getting the data from .csv file. I m able to import the data from .csv to sqlserver. In the file i m having a column which consists the lastname+firstname which will be seperated by ,. When i m transfering the data i m getting the double codes for first and lastname how to avoid it please advise me
Thanku
September 26, 2007 at 7:02 am
can you give some sample data that you are seeing?
-- Cory
September 26, 2007 at 7:47 am
Hi Plz check the sample data
246757SAMMONS,KATHLENE366-xx-xxxx/3/1980
293491HALL,PAULINE369-xx-xxxxx/27/1945
371687CROOMS,VERONICA364-xx-xxxxx/14/1961
526484JORDAN,HAZEL451-xx-xxxxx/8/1945
1009631WHEELER,VIVIAN382-xx-xxxxx/3/1964
1223003DUCKETT,MARY L371-xx-xxxxx/10/1963
1533531LEFLORE,DEBORAH386-xx-xxxxx/19/1975
1538086MOSELEY,JAMES363-xx-xxxxx/17/1930
September 26, 2007 at 8:39 am
I found openrowset to be the best way to import csv files.
Select * into TmpMyTable FROM OPENROWSET(''MICROSOFT.JET.OLEDB.4.0'',
''Text;Database='c:\directory_of_csv_file\';'', ''SELECT * FROM myfilename.csv'')
You may need to update the registry entry for TEXT csv delimited files.
MyComputer\HKEY_Local_Machine\software\microsoft\jet\4.0\Engines\Text
Set "Format" key = CSVDelimited
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply