i can import data by change .CSV to .XLS and import .XLS file, but i hvae copy data from .CSv to .XLS it is not good ,so can you show me how to import .CSV file.
i am using SQL2005
thanks for your help
You could use OPENROWSET function with BULK option:
SELECT a.* FROM OPENROWSET( BULK 'c:\test\values.txt',
FORMATFILE = 'c:\test\values.fmt') AS a;
About OPENROWSET: http://msdn2.microsoft.com/en-us/library/ms190312.aspx
About format files: http://msdn2.microsoft.com/en-us/library/ms175915.aspx
No comments:
Post a Comment