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 |
AKP2008
Starting Member
45 Posts |
Posted - 2009-03-03 : 01:24:48
|
Hi All,I have one requirement. My text file format is like this05322672910514155511571007533732 WENDY GOXMAN 3300 SHELBY DR I have to import this data into my database using bcp. From 1-7 characters i have to insert into col1 and from 8-9 insert into col2 like this i have to insert into table.How can i specify the positions using command prompt.Please help me.Thanks in Advance. |
|
subhash chandra
Starting Member
40 Posts |
|
AKP2008
Starting Member
45 Posts |
Posted - 2009-03-03 : 02:10:37
|
i have used format file also.my issue is about specifying lengths. when i use format file i am getting below error.Incorrect host-column number found in BCP format-file. |
 |
|
subhash chandra
Starting Member
40 Posts |
Posted - 2009-03-03 : 02:30:34
|
If you just want to load data anyway then you can do that by first loading the file in a one column temporary table and then using the t-sql SUBSTRING fucntion to split data in columns and inserting in the target table. |
 |
|
AKP2008
Starting Member
45 Posts |
Posted - 2009-03-03 : 03:28:29
|
My table contains 340 columns. No other way to do this? |
 |
|
|
|
|