How to use SQL Server Database Project

后端 未结 2 1551
萌比男神i
萌比男神i 2021-02-13 21:41

I am running SQL Server 2012 and VS 2010 with SSDT (SQL Server Data Tools) installed. My dev DB uses stored procs, functions, CLR objects, etc. It has a snapshot of prod data of

2条回答
  •  情话喂你
    2021-02-13 21:59

    1. Make changes inside the VS DB project.

    2. Deploy changes to localDB to test

    3. Publish the database to your production server. I prefer to use Schema Compare to do this manually, but you can also publish the project via the right click --> publish menu (which will also create a publishing profile), or using command line arguments. The publish process won't drop and create tables (unless you tell it to drop & recreate the entire db).

    Alternatively, in the project settings you can change the connection string to point to your production server (as pointed out in the comment). However, I recommend against this, as it will then attempt to publish to the production server every time you run a local build (F5).

提交回复
热议问题