Google

Monday, October 8, 2007

How to Perform SQL Query from within Visual Studio 2005 Using Server Explorer

You can perform SQL Query from within Visual Studio 2005 using Server Explorer. I will demonstrate using the Northwind database.

1. Click Server Explorer from the View Menu.
2. Click on the Northwind Database.
3. Click on the Data Menu and select New Query.
4. In the Add Table Dialog that appears, select the Table Tab then select CompanyName field.
5. The SQL Query is automatically created :

SELECT CompanyName FROM Customers

6. Right-Click on the SQL Query above. In the Context Menu that appears, click on :

! Execute SQL

7. The result will be immediately displayed below the SQL Command Box.



8. Alternatively, you can click on the Execute SQL icon in the Toolbar as shown in the red arrow below.