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 Stored Procedure in SQL Server”

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 “How to Create a Table in SQL Server”

How to Create a Database in SQL Server

To create a database in SQL Server using the GUI:

  1. From the Object Explorer, right click on Databases and select New database...
  2. Name the database, adjust settings if required, then click OK

Once you’ve created the database, you can create tables and other database objects. You can also modify any database properties as required.

Continue reading “How to Create a Database in SQL Server”