2

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?

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

I have the same problem but I don't see and option for "GenerateDeployStateChecks" to uncheck. I am using VS2010 Ultimate.
@Rob, strange, I use the same version... You can find this option in Properties\Database.sqldeployment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.