locked
any way to generate and run scripts on production environment automatically after deploying the build? RRS feed

  • Question

  • User-1226190930 posted

    HI,

    I am using Data First approach in my application and now application has expanded a lot. We are good in SQL thats why we used Data First approach initially. My question is that is there anyway to automatically check for database changes from edmx file and run it on SQL server?

    I want this process to be automated so if build gets deployed on staging or production server, all the database changes get executed on SQL server as well, we don't need to run each and every script manually.

    May be I need SQL source control that work on all local, Staging and Production environment, or a library that can do that for us.

    Please help!

    Friday, June 29, 2018 5:11 PM

All replies

  • User1120430333 posted

    I am using Data First approach in my application and now application has expanded a lot. We are good in SQL thats why we used Data First approach initially. My question is that is there anyway to automatically check for database changes from edmx file and run it on SQL server?

    No, unless you write something that's going to do it.

    I want this process to be automated so if build gets deployed on staging or production server, all the database changes get executed on SQL server as well, we don't need to run each and every script manually.

    You should talk to a DBA.

    May be I need SQL source control that work on all local, Staging and Production environment, or a library that can do that for us.

    You need to make sure that the EDMXs in all environments stay in sync with each database schema for a given environment.  Maybe, you need to be posting to SQL Server forums on how to get database schemas to stay in sync across environments during a deployment.

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?category=sqlserver

    Friday, June 29, 2018 6:51 PM