When I deploy dbproj to SQL script and try to run it on another computer I get an error:
The server name in the build script SOMENAME does not match the name of the target server ANOTHERNAME. Verify whether your database project settings are correct and whether your build script is up to date.
There are such lines generated in the script:
IF (@@servername != 'MYNAME')
BEGIN
RAISERROR(N'The server name in the build script %s does not match the name of the target server %s. Verify whether your database project settings are correct and whether your build script is up to date.', 16, 127,N'MYNAME',@@servername) WITH NOWAIT
RETURN
END
Is there any way to allow SQL deployment script to run on any server?
I found a solution: I just have to go to Project Properties -> Deploy -> Edit Deployment Configuration File
and uncheck GenerateDeployStateChecks
checkbox. After that any mention of my server name disappear in deployment script.