Import SQL records from file into sql DB and changing type

biginteger sql sqlbulkcopy sql-server

Question

I created a .txt file using BULK that contains all the records of a sql DB. Now I need to import these records into a new DB. The problem is that I need to change the type of some fields from DOUBLE to BIGINT or the records won't be added to the new DB.

Please, wich functions and how do I have to use them? Thanks

Popular Answer

Importing into SQL Server, you can right-click on the database and select Tasks > Import Data. This will open up the Import/Export Wizard which is a slimmed down version of the same functionality in SSIS.

Once the Wizard is open, you can navigate the through the prompts and eventually get to a screen, Select Source Data, where you can click on the Edit Mappings button and modify the data types of the data being imported.




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why