Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding columns during import from text file 1

Status
Not open for further replies.

vaichi123

Programmer
Dec 2, 2006
20
US
I need to add two new columns in the database table during the import process. These two columns do not exist in the text file that I am importing into the sql server. How could i do this? One of these columns has to be the current year.
 
In your transformation script you will need to add something like this:

Code:
DTSDestination("TRANSACTION_YEAR") = DatePart("yyyy", DATE())

(not tested)

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
The line did not work in the transformation. It throws an error while executing the import process. Invalid procedure call or argument: 'DTSDestination'.
I tried adding columns to the Column mapping and transformations window but I am unable to create new columns in the destination. The preview window does not show any new columns.
 
You need to add the new columns outside your DTS, in either EM or QA. Then you add them to column mapping and transformation script.

Good Luck,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top