Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012 SSDT - How do I create/manage tables now?

I'm trying out Visual Studio 2012 and so far it's good but I created database project, added database *.mdf file to my App_Data and tried to create simple database with relations and I have no clue what to do next. I can't even name my database.

http://msdn.microsoft.com/en-us/library/hh272680(v=vs.103).aspx - AFAIK this article shows how to add relations but I can't find any Foreign Keys node. And also, why can't I edit name? VS2010 database management was so easy and intuitive, now I don't understand how to work with it.

More visual representation of my question and my simple table for example. enter image description here

like image 443
Stan Avatar asked Oct 02 '12 13:10

Stan


People also ask

How do I create a table in Ssdt?

1) Open the SQL Server Object Explorer toolbox using View | SQL Server Object Explorer from Visual Studio. 2) Drill down to the Databases node, then to your database, then to Tables. 3) Right-click and select Add New Table… 4) Visual Studio creates a new table called "Table" and opens it in the Table designer.

How do you create a table in Visual Studio code?

Right-click on Tables and select Add New Table. The Table Designer opens and shows a grid with one default row, which represents a single column in the table that you're creating. By adding rows to the grid, you'll add columns in the table.

How do I edit a table in SQL Server Management Studio?

To modify table data through a view. In Object Explorer, expand the database that contains the view and then expand Views. Right-click the view and select Edit Top 200 Rows. You may need to modify the SELECT statement in the SQL pane to return the rows to be modified.


1 Answers

Table name you can change in Properties window: table properties
relations by right clicking on Foreign Keys:
keys
You can also modify sql in lower pane - all changes will be reflected in graphical tools. I'm find this useful e.g. when I want to copy some columns from one table to another.
You can also make changes on database with another tools, like SSMS (better FK tools I think) and then import this changes via Schema Compare by setting database as source and project as destination.

like image 162
Piotr Sobiegraj Avatar answered Oct 12 '22 22:10

Piotr Sobiegraj