Best Practices for Changing SQL Server 2008 Schema

I am looking for information on the following:

What are the best methods for updating my Dev DB schema to my production database or even more compressed database schema changes in general.

The production database is the background for two separate ASP.NET websites.

Our process of modifying a schema is fairly robust, with each โ€œmigrationโ€ actually representing a .cs file containing schema changes. Then we will use ADO.NET to apply schema changes to db.

My question is more about database connectivity.

I have to stop two sites that access db. I guess I should. Should I put the database in single user mode. It seems like I should, but I'm not quite sure about it.

What can i skip? What are the things that bit you in your hand before changing the database schema.

+5
source share
3 answers

If updates change things like column names, stored proc parameters, etc., always make applications offline before updating the schema.

If the updates are only for things that do not affect the normal processing of data, then you can make it hot. This category is when you add things like indexes, tables, etc.

If someone uses the application while processing the circuit, you may well be in a situation where the consistency of data is deteriorating.

-, (-) . , , ...

. , .

, , Redgate SQL Compare script db. , , , , .

, , . , .

+5

.cs/ado.net, . , "delta".SQL - SQL . , .SQL .

, , , , .. , "" .

/, /, - .. "", dev , .

SQL, "master" SQL, , . !

TFS .

+3

An ideal situation, but not always achievable: you make circuit changes that are compatible with the V <old> version of your site. Then you release V <new> to your web servers. After all your web servers have reached V <new>, you can then perform any cleanup (filling in missing values, etc.), and then make the appropriate changes with a zero value.

0
source

All Articles