Pages

Sunday, August 18, 2013

How to Use Microsoft SQL Server Management Studio

How to Use Microsoft SQL Server Management Studio

Microsoft SQL Server Management Studio, introduced in 2005, is an integrated application used for creating, accessing, administering and developing all components of SQL Server-like databases, users, security, stored procedures and backup. You can use SQL Server Management Studio's workspace to write queries and scripts and to update, delete and create objects with the color-coded Query Editor console, which makes the SQL code more readable. This makes it a powerful interface between the database engine and developer or administrators.

Instructions

    1

    Click "Start," choose "All Programs," select "Microsoft SQL Server" and then click "SQL Server Management Studio." The "Connect to Server" window will open. You can use "SA" or current user name and password. Click "Connect" to open the SQL Server Management Studio window.

    2

    Right-click a database and choose "Properties" to open the "Database Properties" window that lists all the properties of the database, including last database, name, status, owner, the date it was created, size, number of users and collation, which determines the rules for sorting and comparing the data. You can get facts about your database, change the owner, enable indexing and manage database files from this window.

    3

    Click "Databases" in the "Object Explorer" window, right-click a database and select "New Query." A query editor window will open where you can create and modify your queries. For example, if you have a database for your office that has data regarding customers, clients, billing and projects. You can type the following query to view the records in a table:

    Select * from customer;

    Click "! Execute" to run the query and see the results in the window. Alternately, you can use F5 to execute the query.

    4

    Click the "+" next to database name to show a list of objects that are included in the database. Click "Database Diagrams" to see the relationships between the various tables in the database.

    5

    Click "Tables" under database name to show a list of all the tables in the database. Right-click "Tables" and choose "New Table" to create a new table. Enter "Column Name," "Data Type" and check box "Allow Nulls" if the column has null value. You can define other columns in the same way.

    6

    Right-click a table and select "Edit" to modify the table. You can see the SQL script used for creating this table. Right-click the table and select "Design" to see the column names, their data types and if they allow null values. Right-click the "Column Name" to delete it. You can also add a new column name by entering the required details in the blank row. Click "Save" to save all the changes.

    7

    Right-click "Security" in the "Object Explorer" window to list the logins, server roles and credentials. Right-click "Security" and choose "New" and then select "Login." A "Login-New" window will open where you can define a new user and provide access to the database. Enter a login name. Select either Windows Authentication to allow the user to connect using Windows user account or SQL Server authentication to specify a password. Assign a "Default Database" by selecting from the drop-down menu. Select the "Default Language" by clicking a language from the drop-down menu or accept the default values. Click "OK" to create the new user.

1 comments:

  1. This blog is really good I would like to say thanks please share more content on MSBI Online Training

    ReplyDelete