What you want to see on DotNetFunda.com ?
Go to DotNetFunda.com
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 54518 |  Welcome, Guest!   Register  Login
Home > Articles > Visual Studio 2010/12 > Visual Studio 2012 Features - SQL Server Object Explorer

Visual Studio 2012 Features - SQL Server Object Explorer

1 vote(s)
Rating: 5 out of 5
Article posted by Ambily.Raj on 9/1/2012 | Views: 3466 | Category: Visual Studio 2010/12 | Level: Beginner | Points: 250 red flag


Visual Studio 2012 introduced a new feature called SQL Server Object Explorer. In earlier versions of Visual Studio, we have Server Explorer, which opens up a particular connection and work with a single database data. Now with the new SQL Server Object Explorer, we are able to manipulate multiple databases from a database server.

Now from the visual studio itself, we can create tables, define various keys, and create stored procedures and functions. 

Open the SQL Server Object Explorer


Select View -> SQL Server Object Explorer to open the SQL Server Object Explorer.



New SQL Server Object Explorer opens with the SQL Server node.


Add Database Server

Now we need to add our database server to the SQL Server Object Explorer window by right click and select Add SQL Server option.



This will open the Connect to Server window, same as the SQL Server Management server. Specify the Server name and authentication type.



Once connected, new server along with Databases, Security and Server Objects will be displayed in the SQL Server Object Explorer.


Create Table

Expand the database; in our sample I used the NorthWind database. For creating a new table, right click on the Tables node and select “Add New Table” option.



This will open the table designer window, where we can define the table structure and specify various keys associated with the table. Visual Studio will generate the SQL script corresponding to your table definition. You can see various keys, constraints, indexes and triggers associated with the table.

Once we select the Preview database option, Visual Studio will open the Preview Database Updates window from where we can generate the scripts or can update the database immediately.



Generate Script option will generate the scripts shown in the below screen.


 

Create Function

Same way we can create various types of functions by right clicking the Functions node in the tree and selecting the corresponding option.


 

Open Existing Table

Following screen shows the OrderDetails table, various database objects like keys, constraints, indexes and triggers associated with the OrderDetails table. You can see the SQL script for creating the table and associated constraints below the table definition.



 

Conclusion

Server Object Explorer is one of the handy tool added in Visual Studio 2012, which will allow the developers to remotely connect to a database and perform all database operations from Visual Studio itself. This avoids the need for installing the SQL Server in developer system.

 

If you like this article, subscribe to our RSS Feed. You can also subscribe via email to our Interview Questions, Codes and Forums section.

Page copy protected against web site content infringement by Copyscape
Found interesting? Add this to:



Please Sign In to vote for this post.

About Ambily KK

Experience:9 year(s)
Home page:http://ambilykk.com/
Member since:Tuesday, May 18, 2010
Level:Silver
Status: [Member] [Microsoft_MVP] [MVP]
Biography:I have over 9 years of experience working on Microsoft Technologies. I am carrying the passion on Microsoft technologies specifically on web technologies such as ASP .Net and Ajax. My interests also include Office Open XML, Azure, Visual Studio 2010. Technology adoption and learning is my key strength and technology sharing is my passion.
>> Write Response - Respond to this post and get points
Related Posts

This Article Explains you to how to install Xamarins Mono for Android in Visual studio 2012 to develop Android Applications using c# and Dot net Framework…

In my last article on Coded UI Basic Walkthrough, we have seen the Record and Playback Mechanism of Coded UI. In this article I would like to discuss about the ‘Object Identification Mechanism of CodedUI’. How Coded UI identifies the objects present on the User Interface? Each object has some search properties associated with it. Along with this, if the object’s Technology is Web then it also has Filter properties associated with it. Coded UI uses these properties to identify the objects at runtime.

In this quick post you will learn how to generate method stub in Visual Studio.

There are lots of test automation frameworks to support the test automation of an application. Coded UI is the new testing model introduced in Visual Studio 2010. This will support the automation of Manual test steps etc. Coded UI is an automation framework which enables us to record a set of action, creates the code for the same and allows us to playback the recording for testing the application. It also gives the flexibility to write the custom code [hand-coded]. In this article we will discuss about how to create our first CodedUI test project.

In this article we will learn Page Navigation without using Navigator.js and passing value between two pages using using Session, using Roaming DataStore and using ApplicationDataCompositeValue in Metro Style Apps

More ...
About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/22/2013 1:32:56 PM