What is SQL Server?

SQL Server is a relational database management system (RDBMS) developed by Microsoft. It is Microsoft’s enterprise level RDBMS offering, and is a more sophisticated and robust system than Access, which has traditionally been a desktop system.

SQL Server’s main competitors are Oracle Database, MySQL (now owned by Oracle), PostgreSQL, and IBM’s DB2.

SQL Server is a client-server based system, which means that it operates as a server, typically containing many databases, with multiple clients accessing the databases from across a network. These clients are often other applications (such as a website or CRM system). This is in contrast to desktop systems, where the database will often (but not necessarily) reside on the user’s computer.

Continue reading

How to Create a Table in SQL Server using a Query

To create a table in SQL Server using a query:

  1. In the SQL Server Management Studio, click the New Query button on the toolbar
  2. Type or paste a CREATE TABLE script (example below)
  3. Click the ! Execute button on the toolbar

Here’s an example:

Screenshot of SSMS with the New Query button highlighted.
Clicking the “New Query” button on the SSMS toolbar opens a new query. Clicking “Execute” runs the query.

Continue reading

How to Use the Query Designer in SQL Server

To use the Query Designer in SQL Server:

  1. Open a new query by clicking New Query on the toolbar
  2. Open the Query Designer by selecting Query > Design Query in Editor... from the top menu
  3. Add the tables you want to run the query against
  4. Build the criteria for your query then click OK

The query will appear in the query window. To run the query, click ! Execute or press F5

Below are screenshots for the above steps.

Continue reading

How to Create a View in SQL Server

To create a view in SQL Server:

  1. Open a new query by clicking the New Query button in the SSMS toolbar
  2. Type or paste a CREATE VIEW statement (example below)
  3. Run the script

The view will now be created in the database. You will be able to see it under the Views node in the Object Explorer.

You can now use SELECT statements against the view in future queries.

Below are screenshots of the above steps.

Continue reading

How to Create a Stored Procedure in SQL Server

To create a stored procedure in SQL Server:

  1. Click New Query on the SSMS toolbar
  2. Type (or paste) a CREATE PROCEDURE statement (example below)
  3. Click the Execute button on the toolbar

This will add the stored procedure to the database. You can see it under the Stored Procedures node in the Object Explorer.

Below are screenshots and more detail for the above steps.

Continue reading

How to Create a Table in SQL Server

To create a table in SQL Server using the GUI:

  1. Ensuring that the right database is expanded in Object Explorer, right click on the Tables icon and select Table... from the contextual menu
  2. A new table will open in Design view. Add the columns, their data types, and column properties.
  3. Save the table (either from the File menu, or by right-clicking on the table tab and selecting Save Table1)

The table will appear in the Object Explorer under the Tables icon for the applicable database.

Continue reading