Search code examples
sql-servervisual-studio-2013sql-server-data-toolsdatabase-projectdacpac

Can I manage database using database project without knowing connection string?


I have created database project. I am able to upgrade my changes in my sql server. Now I have deploy the same changes on another environment. Also I dont want to change my previous data. I dont have to access that Sql server so I don`t know the connection string.

I have some options, like to deploy the .dacpac file or .sql script, but it first delete the database then creates new one. So that I loosing my data.

Please help me. If any option is there?


Solution

  • The options I see for this are:

    • Ask for a backup (or extract schema tables using task-->Generate scripts ion ssms) - restore this somewhere and use sqlpackage to generate a deployment script you can ask them to run
    • Ask them to run sqlpackage.exe and either generate a script or run it directly
    • Ask them for permissions so you can do it

    If the database is being deleted then you have the option "CreateNewDatabase" set to true which would be bad in a production environment so remove it or set it to false!

    If they run it or you ask for permissions, these are the minimum permissions you need to generate a script (to run the script you will probably need dbo):

    https://the.agilesql.club/Blogs/Ed-Elliott/What-Permissions-Do-I-Need-To-Generate-A-Deploy-Script-With-SSDT (my blog)