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 |
|
dexter123
Starting Member
4 Posts |
Posted - 2012-03-01 : 17:11:03
|
| I have a space delmited file as below and would like to create a table with two columns. Time_Stamp=Wed Feb 29 00:01:16 2012Char_Results=820yytUITTime_Stamp=Wed Feb 29 00:02:45 2012Char_Results=710jutyWDTime_Stamp=Wed Feb 29 00:07:05 2012Char_Results=JUH678UJTime_Stamp=Wed Feb 29 00:08:25 2012Char_Results=BM90KLUITime_Stamp=Wed Feb 29 00:11:19 2012Char_Results=YHE43rRT CREATE TABLE tran_data ( date_time varchar (100), char_data varchar (50))Giving errors |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-01 : 23:05:08
|
| whats the issue you're facing? how are you trying to populate table?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
dexter123
Starting Member
4 Posts |
Posted - 2012-03-02 : 08:07:42
|
| i know i can do this with one column and bulk insert using below, but i need to seperate the text file into two colums one column with date and timme information and the second column with the char_results as in my first post.---CREATE TABLE trans_data---(date_time varchar (100))BULKINSERT trans_dataFROM 'c:\temp\trans.txt'WITH(DATAFILETYPE = 'char',FIELDTERMINATOR = '\O',ROWTERMINATOR = '\n')GO |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-02 : 12:14:34
|
| you can use a SSIS package for that. use derived column transformation to spilt column values inside data flow task which does the data transfer------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|