SQL Server 2005 Introduction to SQL Server Management Studio - Exercise 1: Exploring the Environment (Page 2 of 6 ) Scenario In this exercise, you will become familiar with the new SQL Server 2005 administration tool, called SQL Server Management Studio. SQL Server Management Studio is a new tool built for SQL Server 2005. It combines the functionality of the Enterprise Manager snap-in and the Query Analyzer. Although this is the main tool for administering one or more SQL Servers, you can also use the SQL Server Management Studio for executing queries and scripts, and for managing SQL Server projects. The SQL Server Management Studio tool is based on the Microsoft Development Environment used in Visual Studio 2005 to create applications. If you are not already familiar with Visual Studio 2005, using the SQL Server Management Studio tool will help you learn to use the new Microsoft Development Environment for Visual Studio 2005. TASKS DETAILED STEPS - Open SQL Server Management Studio and connect to your server.
- Click in the virtual machine window.
- Press Right-ALT + DEL.
- Logon as Administrator with a password of pass@word1.
- From the Windows task bar, select Start | All Programs | Microsoft SQL Server 2005 | SQL Server Management Studio.
- When the Connect to Server dialog box opens, verify that SQL Server is selected as the Server type, verify that Server name is same name as the host machine or set it to localhost, and verify that Windows Authentication is selected as the authentication method.
- Click the Options button to display additional connection options.
- Click the Connection Properties tab.
Note that the following options are available:
- You can configure the network protocol to use for this connection, which might be different than the protocol you use for other connections.
- You can configure a connection timeout, which controls how long to wait for the connection to be made.
- You can configure an execution timeout to specify how long to wait for response from a query.
- Examine the options available on the Registered Servers tab.
Note that you can export your server registration information, or import registration information from another server. This facility can be valuable for large organizations with many SQL Server administrators who all want to have the same servers registered.
- Click Options again to hide the additional options tabs.
- Click Connect.
Note the various areas of the SQL Server Management Studio:
The lower left pane is the Object Explorer, which appears as a tree view on the left side of SQL Server 2000 Enterprise Manager. Above that is the Registered Servers pane, containing a list of servers to which Management Studio can connect.
The right side of the SQL Server Management Studio contains the tools for managing projects. On the top right is the Solution Explorer. Below that is the Properties Window. If the Solution Explorer is not visible, you can choose to display it by selecting View | Solution Explorer. If the Properties window is not visible, you can also enable that window from the View menu, or by right-clicking on any object in the Solution Explorer window and choosing Properties Window. At the moment, the Solution Explorer is blank because no solution is currently loaded.
The location of all of these windows and browsers can be changed, and you can remove the ones you don’t want or need. You can undock and move windows by double-clicking on the window’s title bar. You can reset the window layout by select Window | Reset Window Layout.
If you close any of the windows, you can restore them from the View menu.
- Use TSQL to execute a stored procedure.
- Click the leftmost button (New Query) on the standard toolbar, and then select New SQL Server Query to open a SQL Query Window. When asked to connect to the server , click Connect.
- The query window appears in the center portion of the SQL Server Management Studio, and is tabbed with the Start Page. All additional query windows will be tabbed as well.
- In the query window, enter the following code:
EXEC sp_who
- Press F5 or click the Execute button on the toolbar to execute the query.
You can disconnect from SQL Server without closing the query window by using the Query | Connection | Disconnect menu option. Alternatively, you can add a Disconnect or Disconnect All button to the toolbar. Right-click on the toolbar and choose Customize. Go to the Commands tab and select Query in the leftmost list box. You can then drag any command from the rightmost list onto an existing toolbar.
Click Close to dismiss this dialog box.
- Open and use a script file from a project.
The scripts you’ll need to run for the remainder of this lab have all been written for you.
Click File | Open | Project/Solution.
Select C:\SQL Labs\Lab Projects\Administration Lab\Administration Lab.ssmssln.
Click Open. If the system prompts you to save changes as you load the solution, select No.
You should see the Administration Lab solution in the Solution Explorer window on right side of the Management Studio. There are five projects, one for each of the five exercises in this lab. Under Exercise 1, expand the Queries folder, and double-click the script called ServerProperties.sql.
USE master
SELECT SERVERPROPERTY('ServerName') SELECT SERVERPROPERTY('Edition') SELECT SERVERPROPERTY('ProductVersion') SELECT SERVERPROPERTY('ProductLevel')
To execute the batch, press F5 or click the Execute button on the toolbar. If prompted, reconfirm your server name and authentication mode in the Connect to SQL Server dialog box.
Note the edition and version number of the SQL Server you are connected to. You may have to scroll down to see all of the results.
Next: Exercise 2: Attaching a Database >>
More MS SQL Server Articles More By MSDN Virtual Labs |