Friday, March 30, 2012

Load data from comma delimited text file

Hello, i need to load some data from a long comma delimited text file, How can a i do that, using t-sql?, thanks for your help!!!!!what do you mean "long"? is there a row delimiter in the file?|||the file has 25.000 ++ rows, and yes, is comma delimited!|||click the start button on your desktop and then click run
in the run dialog box type dtswiz

when the import export wizard opens up perform the following tasks..

set the source as your text file

set the destination as your table

set any transformations

save this as you need to ( i always save to a com storage file)

schedule if you need to

click finish...|||Bulk Insert yourtable
From 'c:\yourtextfile.txt'
With (FieldTerminator = ',',
RowTerminator = ',\n',
CodePage = 'ACP',
TabLock);|||The bulk insert is that i was looking for. Thanks for your help!!!

No comments:

Post a Comment