I followed the guide at http://blogs.adatis.co.uk/jonathon%20eveoconnor/post/Using-TeamCity-to-Automate-Building-and-Deployment-of-Database-Projects to set up SQL build and publish from TeamCity.

The build step works great, but I'm stuck when it comes to publishing. I've set the step up as below, which matches what is in the guide, but I'm getting an error.

Step 2/2: Publish (MSBuild) (2s) [Step 2/2] KAInternal\KAInternal.sqlproj.teamcity: Build target: Publish [KAInternal\KAInternal.sqlproj.teamcity] SqlPublish [SqlPublish] SqlPublishTask [SqlPublishTask] C:\TeamCity\buildAgent\work\1472f1322571ddd\KAInternal\bin\Debug\KAInternal.sqlproj.publish.sql error Deploy72002: Unable to connect to master or target server 'KAInternal'. You must have a user with the same password in master or target server 'KAInternal'. [Step 2/2] Step Publish (MSBuild) failed

I've searched a fair bit, but everyone seems to believe this is a permission issue on the source machine, well my publish profile is using the built in "sa" SQL Server account to publish (for now, mainly to disprove this theory).

Here is the publish profile XML:

<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <IncludeCompositeObjects>True</IncludeCompositeObjects> <TargetDatabaseName>KAInternal</TargetDatabaseName> <DeployScriptFileName>Staging_KAInternal.sql</DeployScriptFileName> <TargetConnectionString>Data Source=192.168.194.6;Persist Security Info=False;User ID=sa;Pooling=False;MultipleActiveResultSets=False;Connect Timeout=60;Encrypt=False;TrustServerCertificate=True</TargetConnectionString> <BlockOnPossibleDataLoss>True</BlockOnPossibleDataLoss> <ExcludeLogins>True</ExcludeLogins> <IgnoreRoleMembership>True</IgnoreRoleMembership> <ExcludeUsers>True</ExcludeUsers> <ProfileVersionNumber>1</ProfileVersionNumber> </PropertyGroup>

And the publish step in TeamCity

Hopefully someone can point me in the right direction, thanks in advance.