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 |
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2007-02-08 : 14:59:36
|
Guys,I have txt file with following valuesfname lname______________Tom GrayTim JunkI want to be able set a job to import this into NAME table 10pm every nightNAME table has the following columnsFNAME VARCHAR(20)LNAME VARCHAR(20)DNAME VARCHAR(50)after I load the data I concatenate FNAME and LNAME into DNAME. I want to setup a job then to export out DNAME columnis there any way this can be acconplished using dts jobThanks |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-02-08 : 15:05:19
|
Yes - what problem are you finding doing it.Would probably be simpler using bcp - and do you need to hold DNAME?==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
|
|
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2007-02-08 : 15:12:01
|
I am trying to cross the first hurdle which is trying to load the data as part of daily jobwhen I try to execute this I get the below message even though the txt file seem to be okay.BULK INSERT Colonial..Collin_images FROM 'c:\source.txt'WITH ( DATAFILETYPE = 'char', FIELDTERMINATOR = ',', ROWTERMINATOR = '\n')Server: Msg 4832, Level 16, State 1, Line 1Bulk Insert: Unexpected end-of-file (EOF) encountered in data file.Server: Msg 7399, Level 16, State 1, Line 1OLE DB provider 'STREAM' reported an error. The provider did not give any information about the error.OLE DB error trace [OLE/DB Provider 'STREAM' IRowset::GetNextRows returned 0x80004005: The provider did not give any information about the error.].The statement has been terminated.any suggestions?Thanks |
|
|
ekb18c
Starting Member
18 Posts |
Posted - 2007-02-14 : 23:44:24
|
What does the txt file look like?It is:fname,lnametom,grayjim,junkalso when you export you can concatenate fname and lname rather than create a derived column (dname).Not sure if it makes a difference but.. DATAFILETYPE = 'char', when your table columns is varchar?Also how many rows of data are you importing? Rather than using bcp, why not just a simple tranformation.www.sqlnerd.com |
|
|
|
|
|
|
|