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!

import data but changing data along the way!!

Status
Not open for further replies.

stewglyn

Programmer
Apr 4, 2002
9
GB
I'm new to SQL Server and would like some help. I have a table in 2000 called clients. I want to import data in from another 2000 table called clients (which is in the original DB.)However the table in database 1 which I'm importing from has differing datatypes and sizes. How can I get the data in WITHOUT changing the new db2 to match the table schema of db1? There is vb code to do it if so what does it look like. Or is the dts a better bet.

Thaks alot in advance for any help

stewart
 
Data Transformation Services (DTS) is designed for doing just that. You would use two data sources and a VBScript or JavaScript transformation.
 
Actually, using an ActiveX script task can slow a transformation down . You should see if you can do it with T-SQL code using an Execute SQL task or using the data pump task.

Whatever you do, don't forget to figure out how to handle the records where the data conversion is not compatible. For instance where they used a text field in the data to be converted for the information to be passed to a date field in your table. The transformation works for most but not when they entered 'ASAP'. If you don't plan to check for and handle these things, your transform will bomb.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top