Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesI have a .txt file that I need to add to an existing table, which is made up of Varchar, Char, numeric and int fields. What is the best way to do it. The first thing I tried was importing the .txt file, and then going into the design and changing the field type, but I hit problems on the Numeric fields. Then I tried changing the field types from varchar to different types at the transfom stage of importing, but that failed too. Regards, Ciar=E1n
Post Follow-up to this messageI assume you're using DTS, but without knowing what "I hit problems" means, it's hard to give a specific answer. One general approach is to load the data into a staging table, which may have a different structure or data types than the target table, then use TSQL to clean up and transform the data before an INSERT into the target. If this isn't helpful, you'll probably have to give some more details - your MSSQL version, exactly how you're importing the data, what the source data looks like, the DDL for the target table, the problems/errors you got etc. Simon
Post Follow-up to this messageI assume you're using DTS, but without knowing what "I hit problems" means, it's hard to give a specific answer. One general approach is to load the data into a staging table, which may have a different structure or data types than the target table, then use TSQL to clean up and transform the data before an INSERT into the target. If this isn't helpful, you'll probably have to give some more details - your MSSQL version, exactly how you're importing the data, what the source data looks like, the DDL for the target table, the problems/errors you got etc. Simon
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread