Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sathishmangunuri
Starting Member
32 Posts |
Posted - 2010-11-29 : 06:58:38
|
how to insert data into table having 5 columns and text file having 3 columns.Example:Table has id,name,age,salary,[phone number] columns andtext file having values for id,salary.age fields.how to match text field columns with table fields using bulk insert with format files.could any one explain me please.Thanks in advance!!! |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2010-11-29 : 07:00:44
|
Easiest way is to create a view on the table with the columns from the text file and bcp into that.If you really wnat to use a format file have a look athttp://www.nigelrivett.net/SQLTsql/BCP_quoted_CSV_Format_file.html==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|