1

I have 917419 records in a table in a SQL Server 2014 database. I want to move theses records into a SQL Server 2005 database.

I have generated script into a file using "generate and publish wizard" for one table, and I ran the script file into command prompt by using

sqlcmd -U sa -P abc123* -S XXX\SQL2014 -i E:\script.sql -o E:\Scriperror.txt

It executed successfully. Only 915419 records are inserted into SQL Server 2005 database. The remaining 2000 records are missing.

Also we have compared the both records in excel and we inserted missing records manually. Our client want to move data to SQL Server 2005 every two months. So comparison and manual insert is not possible.

Can anyone help me why the 2000 records are missing? Which is the best way to resolve this problem?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Vijeeshkumar vofox
  • 441
  • 2
  • 5
  • 17
  • Are both Servers in the same system? If yes I'd try with [linked server, see a related answer here](http://stackoverflow.com/a/34205434/5089204). If not, you might have a problem with the length of the created file. Maybe the last records are missing... You could try to split it in two parts... – Shnugo Jan 08 '16 at 08:28
  • Does the 2000 missing records have something in common ? null on same field or something else ? – podosta Jan 08 '16 at 08:42
  • There was error notification in E:\Scriperror.txt ? – bdn02 Jan 08 '16 at 09:01

0 Answers0