I am using sql server 2008 r2 express. I am getting some problems when i use import data feature to import data from one database to another. I am using SSMS to do it. While using the wizard i choose "Select identity insert" option to copy the identity element property. By using this identity elements are imported properly. But after importing i compared the source database and destination database and found some changes!!. All NULL values in the table are replaced by 0. So how can i avoid it.Is there any option to copy it as it while using import data wizard? Please help
Sql-server – Import Data replaces NULL with 0
importsql serversql-server-2008-r2ssms
Related Question
- Sql-server – Imported database file size different with original database file
- Sql-server – SQL import data when both source and destination has data and identity column
- Sql-server – SSMS: Import from flat file (.csv)
- Sql-server – SQL Server Import Wizard Excel into SQL Server 2016 Error 0xc020901c
- Sql-server – How to set ‘Enable identity insert’ for all the tables at once during importing data in SQL Server
- Sql-server – Violation of PRIMARY KEY constraint in SSMS import/export wizard
Best Answer
Choose to save the package instead of running it right away.
Then edit the dtsx file and on your copy task check "keep nulls".
Then run the dtsx.
I didn't test it but think it will solve your case.
Testing the suggestion on the comment on express with advanced services... it worked well:) You create the destination table, set a null default on the column and after importing data with the dtsx you remove the default or set it to whatever you want. dtsx import will replace nulls with the default value of the column when you can't check the "keep nulls".