SQL Server 2005 Introduction to SQL Server Management Studio - Exercise 3: Exploring an Existing Database
(Page 4 of 6 )
Scenario
In this exercise, you will use the options available in the SQL Server Management Studio to discover table and procedure definitions. You will also use the Management Studio’s query tool to execute basic SQL commands to examine table data.
TASKS DETAILED STEPS
- Examine the properties of the AdventureWorks database.
- Expand the Databases folder in the Object Explorer window and right-click on the AdventureWorks database.
- Click Properties. Note that the Properties dialog box is non-modal and has its own button in the taskbar. You saw the value for several properties in Exercise 2 when you executed the DatabaseProperties.sql script.
- Click on each of the categories in the left pane to see what properties are read-only and which are updateable.
- Click Cancel to close the Database Properties window. You may have to double click the title bar to see the Cancel button.
- Write a query to examine some data.
NOTE: Even though the GO is not necessary for SQL Server to execute the queries, or for you to select and run individual batches, using GO is the only way that the query tool knows how to separate the batches.
- In the Solution Explorer window, expand the Exercise 3 node, and double-click the GroupBy.sql file. This adds the following SQL to the query window:
USE AdventureWorks
GO
SELECT City, StateProvinceID, CustomerCount = count(*)
FROM Person.Address
GROUP BY City, StateProvinceID
HAVING count(*) > 1
ORDER BY count(*) DESC
GO
- Select the query you just entered, and then press F5 or click the Execute button on the toolbar to execute the query.
Next: Exercise 4: Creating a New Database >>
More MS SQL Server Articles
More By MSDN Virtual Labs