0

I have a table already stored in sql server with all the columns and the data type of the columns. I am now trying to import a txt file into sql server. But since all the fields are already in the string format, it is not able to import the data into the server. Is there any way to change the format of the datatype within the txt file to match that of the table within the sql server? The number of columns are 150 to import

1 Answer 1

1

You may need to look into creating a SSIS package and adding the data conversion tool to cast/convert the data being imported into the correct datatype.

Sign up to request clarification or add additional context in comments.

3 Comments

The other option is to use the import wizard that allows you to change the datatype coming in. However, this might not give you enough flexibility that you need.
dklingman, the problem with the import wizard is it still gives me a lot of errors and I have to do this for about 10 txt files. Some are data type conversion errors. Hence to use the import wizard and change 150 variables every time is a little bit painful
That's what I figured and why I would suggest going the route of the SSIS package to do this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.