SQL Server Export

[expired user #8807]'s profile image [expired user #8807] posted 9 years ago in Import/Export Permalink
Hi,

I have a problem when I create a MS SQL Server Export/Backup. The created sql files have some small bugs:
* DROP Statement with if exist does not work
* CREATE Statement if not exist does not work
* bulk insert don't consider the maximum of 1000 rows
It looks like that some MS SQL Server specific SQL syntax is not considered during the export.
[expired user #8812]'s profile image [expired user #8812] posted 9 years ago Permalink
DKula -

I have a problem with private server, please leave your email address! thanks!
[expired user #8807]'s profile image [expired user #8807] posted 9 years ago Permalink
What do you mean? I am a registered user where my email is related to my account
[expired user #8823]'s profile image [expired user #8823] posted 9 years ago Permalink
I had issues as well. When I exported an MS SQL database to a .SQL file (specifying CREATE databases and tables but no DROPs and requesting INSERTs for all data), when I then disconnected from the origin server and connected to my target server, the .SQL file would not run (meaning it got derailed in batch mode due to errors).

My next step was to attempt an export from my origin server/database directly to my target server. And almost every (and perhaps every) command thrown at the target server resulted in an error. (I think the database creation step failed right at the start, so all further commands were then referencing an unknown database.)
jfalch's profile image jfalch posted 9 years ago Permalink
is the target server MSSQL also ?
[expired user #8823]'s profile image [expired user #8823] posted 9 years ago Permalink
Yes. I was trying to copy a database and all its data from one MS SQL server to another.
[expired user #8823]'s profile image [expired user #8823] posted 9 years ago Permalink
Right from the get-go, the first executable statement in the output file is:

CREATE DATABASE IF NOT EXISTS "<dbname>";

But that is not valid T-SQL, as IF NOT EXISTS is not supported. So all bets are off when you try to restore to a different server, since no db gets created.

Please login to leave a reply, or register at first.