MS DTS - Different data types between source data and destination table

Hello Experts,

I  am trying to use MS DTS to import data from a text file into a table residing on a database, but I've noticed that the data in the first column from the text file being imported, has a numeric data type contains numbers and letters, but the data type of the field in the table that data is being imported to, is Numeric (28,0) [Customer_ID field]. And if I attempt to Alter the table to change the Data type to Varchar, I get an error message indicating that this ALTER STATEMENT would violate the established PKY Key contstraints.  

I would greatly appreciate suggentions that would faciliate in the mapping or transferring of this column data to the appropriate column within the SQL Server 2000 Database.

Thanks Experts!

Studious01
studious01Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bruintjeCommented:
Hello studious01,

changing the primary key with an alter means you really do not care about the key at this point?
then why not remove the key with all consequences like other tables relying on this key also loosing their foreign key etc....

next alter the datatype for this column and import the data, then add a primary key again and relink all other tables

but i still wonder if this is what you want, maybe it would be better to import the data into a new table then add the rows that are correctly formatted to the original table or if this is really the new format then add the rows from the original table to the new table and link all depending tables to this new table this way you always can go back to the previous setup if needed with your data and keys intact

hope this helps a bit
bruintje
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
studious01Author Commented:
bruintje,  I decided to follow through with your suggestion and it worked fine.

Thanks again!

- Studious01
0
bruintjeCommented:
glad it worked and thanks for the grade :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.