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-30 : 23:58:32
|
I have following text file101,Ap1236,red102,MH5698,white103,TM2136,greenI have following tableCREATE TABLE CARNUMBER ( [No] int ,State nvarchar(50) ,Number nvarchar(50) ,Color varchar(20) )i have created default format file for the above table.but how can i modify this format file such that i should get 1st field data into 1st col and 2nd field data should split into 2 parts ex AP1236 as AP and 1236 and Ap should goes into 2nd col and 1236 into 3rd col,and 3rd field should go into 4th col of table.can any one give solution please.Thanks,sat. |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-12-01 : 02:20:07
|
1 Import data to a staging table that has three columns2 From the staging table, insert into target table by splitting the second column's valueMadhivananFailing to plan is Planning to fail |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-12-01 : 13:12:10
|
or you need to use some ETL tool like SSIS and do the transformation inside it------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|
|
|