SQL Server Object Explorer in VS 2012
If you use Visual Studio AND SQL Server Management Studio, you’ll be glad to hear that the SQL Server Management Studio tools, called SQL Server Data Tools (SSDT), are now a part of Visual Studio 2012. You can create, edit, and delete SQL Server tables and stored procedures, you can write and execute queries, you can view and edit database data, and so on, all from within Visual Studio.
NOTE: You can also get SSDT for Visual Studio 2010 SP1. See this link for more information.
SSDT includes database project types, the SQL Server Object Explorer toolbox, and tools to work with analysis services, reporting services and business intelligence. This post focuses on just the SQL Server Object Explorer.
Select View | SQL Server Object Explorer from the Visual Studio menu to display the toolbox.
If your SQL Server does not appear on the list, click on the Add SQL Server button in the toolbar or right-click on the SQL Server node and select Add SQL Server. Enter the information to connect to one of your SQL Server databases and your SQL Server should then appear on the list.
NOTE: You can connect to any running SQL instance, including SQL Azure.
Once your instance of SQL Server appears on the list, you can drill down to see the databases and their details. You can list the tables, views, and stored procedures under each database.
For example, here are the tables and stored procedures in one of my databases:
Follow these links to see some of the things you can do with the SQL Server Object Explorer:
- Add a New Database
- Add a New Table
- Adding Stored Procedures with SSDT
- Entering Data with SSDT
- Executing Stored Procedures with SSDT
- Executing a Stored Procedure with Parameters using SSDT
Use the SQL Server Object Explorer to work with your SQL Server databases in Visual Studio 2012.
Enjoy!
Jeppe — November 16, 2012 @ 2:56 am
Is it possible to restore a database from this the SSDT ? I cant find that option anywhere. would be great
Ivan — November 28, 2012 @ 12:04 pm
SQL can execute qrueies against a database, retrieve,update,insert data from a database and empty refer to an empty result of no rows and NULL refer to a table with one row holding a NULL value.
DeborahK — July 30, 2013 @ 10:25 am
Jeppe –
“Is it possible to restore a database from this the SSDT ? I cant find that option anywhere. would be great”
I have not seen an option to restore a database from the SQL Server Object Explorer. That is still one that you need to go to the Management Studio for. Same for a backup.