Visual Studio Database Project and SQL Server Management

I like to use SQL Server Management Studio to modify and update my database. It is simpler, faster and safer than writing, it changes itself.

I studied the use of some kind of version control for databases and read about using the SQL Server database project in Visual Studio 2010.

I burned an existing database and imported it into a new SQL Server database project. Now, from what I can say, there is no GUI for editing the database; I cannot add columns, change data types or edit existing data without my own script. For example, in SQL Server Management Studio, I can right-click on the table name and select "Design", and then add / edit columns, change data types, etc. From there.

While Visual Studio Database Projects projects have some features that are not available in SQL Management Studio, I don’t think I can live without a “table designer”.

Is there a table constructor built into the VS Database Project? I just do not see?

+4
source share
4 answers

No, there is no table designer.

If you are starting to think about the version that controls your database, you should also think about writing real SQL to implement your database objects. This is the route with which you crash the databases. If you cannot write SQL for your changes to the database, how can you view and evaluate the difference between how the table was 6 months ago and how it is now in your project?

+3
source

I have been using VS2008 Database Projects for about 10 months for our version control. From time to time, I still use the table builder; it's a quick and easy tool. I believe that most of your questions focus on the workflow, as this is what I consider to be the most difficult part of development in a version-controlled environment. I would recommend continuing to develop your objects in Management Studio or, nevertheless, it’s convenient for you, and then create a script and import this script into the database project. When doing some quirks, you always need to script to create an instruction, even if you are making changes in your environment. In addition, you will need to remove any USE statements for your database, since the context in which you import your scripts will always be in the project into which you import.

We found that a successful workflow to facilitate code deployment is to have a production branch that branches into Main (development branch) and then test. All new developments are carried out in Main and are combined using a set of changes in each other's environment as needed.

You can import your scripts from the development environment by right-clicking in the solution and clicking on the import scripts. I recommend that you check all options to overwrite existing objects, import advanced properties, and import permissions.

+3
source

After changing the database schema using the GUI GUI tool, you can use the database project schema comparison tool to update the project files (specify the source that will be your database and your project will be the target). That way, you can continue to use the GUI tool to manage the schema, and the database project will manage the versions.

+1
source

There is no visual table designer in the Visual Studio 2010 Database Project. But there is a workaround regarding version control for databases - you can use SQL Server Management Studio along with Red Gate SQL Source Control .
It costs money, but definitely worth it.

0
source

Source: https://habr.com/ru/post/1341837/


All Articles