DB Designer in Visual Studio 2010

I need to create a completely new Sql Server 2008 database and you want to use the database project in Visual Studio 2010 (Ultimate). I created a project and added a table to the dbo schema.

The .sql table is displayed only as plain text, but with colors. He has no designer, no Add Column, and no autocomplete. Existing column properties are grayed out.

Usually I use a database project only for storing .sql files for version control purposes, but I assume that this can help me in developing the database. He currently does not offer such help, and I think because I am doing something wrong. Perhaps I need to deploy the database to the server first, or something similar. I was looking for a getting started guide, but all the tutorials I found start with importing an existing database.

Please help me understand what a database project can do for me and how.

Thanks,
Asaf

+4
sql-server visual-studio sql-server-2008 visual-studio-2010
source share
2 answers

The whole idea of ​​the VSTS database is to set you on the right path, i.e. store definitions of database objects as .sql files, and not as some kind of fancy diagram. Any modification you make to the objects you do by modifying the definition of SQL. Thus, you can make any changes to objects, as allowed by the DDL syntax, as opposed to what you think the visual designer du-jour cannot do. Not to mention the many SQL code generation errors associated with all designers.

Closing a visual representation is a diagram representation that displays tables, columns, indexes, etc. in a tree view, and you can see the properties from there.

By focusing the development process and the Visual Studio project on .sql source files, teams can collaborate in developing the database using proven and proven version control methods (check-out / check-in, lock file, conflict detection and merge integration, branching, etc.). d.).

The output from the VSTS DB project is a .dbschema file that can be deployed to any server using vsdbcmd . This is an intelligent deployment that synchronizes the circuit (merging a new object, modifies existing ones) and can detect and prevent data loss during deployment. In contrast, the β€œclassic” way to do this (from VS Server eExplorer or from SSMS) was the MDF file itself, the database itself, as the supplied product. This creates huge deployment problems. Deploying v1 is really smooth (just copy the MDF done), but as soon as you want to release v1.1, you are stuck: you have a new MDF, but the production runs on its own MDF and does not work, you want to replace it with your own, as this means data loss. Now you turn around and want you to have some kind of history of deploying a version of the database schema, and that's exactly what VSTS DB does for you from day 0.

+5
source share

You might be better off downloading SQL Server Management Studio for SQL Server 2008 Express - http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796

With this tool, you can create your database using the visual tools provided by this software. You can run your .sql script to create the database, and then visually adjust the column parameters, table relations, etc.

As soon as your database opens Visual Studio and open the connection to this database using Server Explorer.

Visual Studio is suitable for simple settings and changes in the existing database structure, but for something serious, like creating a database from scratch, I would recommend using Management Studio. It is free and built for this purpose :)

+2
source share

All Articles