0
votes

I want to deploy all my SQL Server scripts using DACPAC. I imported database, I want to make a change in SQL Server and commit the SQL server project and create dacpac and execute dacpac in VSTS. I want the scrips moved to multiple environments, each environment has its own logins/users. So I don't want to consider users/Logins When I removed all the logins under security folder. It throws a lot of unresolved references after deleting logins from the project. What is the best way to remove it?

1
Any chance you still have users or role memberships tied to those logins/users? Look at the unresolved references and clean those up. Once you get rid of the bad references, you should be able to build. - Peter Schott
peter Schott , I have only tables in it. It does not have any reference with user. How to find whether is table is referring a user - Baskar Manoharan
You'd see it in the model if you imported it from a database/script. Or just search for any CREATE USER type statements in the SQL for that project. You should be able to double-click any of the errors and it should take you to the offending SQL Statement in the project. - Peter Schott

1 Answers

0
votes

consider deploying your dacpac by providing a connection string in publish.xml for deploying dacpac

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IncludeCompositeObjects>True</IncludeCompositeObjects>
<TargetDatabaseName>dbname</TargetDatabaseName>
<DeployScriptFileName>dbname.sql</DeployScriptFileName>
<TargetConnectionString>Data Source=<name>;user:<ussrname>;password:<password></TargetConnectionString>
<BlockOnPossibleDataLoss>False</BlockOnPossibleDataLoss>
<DropObjectsNotInSource>False</DropObjectsNotInSource>
<ProfileVersionNumber>1</ProfileVersionNumber>
</PropertyGroup>
<ItemGroup>

</ItemGroup>
</Project>