As you know I have started a new series on "Exploring SSMS" by which I will be posting some features that are available in SSMS which will be very helping during the development. In this post we will see how to insert code template for creating a table, stored procedure, login etc in the SQL Server management studio.
In the Tool bar, goto Edit-->IntelliSense-->Insert Snippet. You will get an option for Function, table, stored procedure etc. If you want to create a template for table, select table-->Create table.
The following code will be added in the query window
CREATE TABLE dbo.Sample_Table
(
column_1 int NOT NULL,
column_2 int NULL
);
If you want to create a code template for Stored procedure with Output parameter, choose Stored Procedure-->Create procedure with OUTPUT parameter. The following code will be added in the query window
CREATE PROCEDURE dbo.Sample_Procedure
@param1 int = 0,
@param2 int OUTPUT
AS
SELECT @param2 = @param2 + @param1
RETURN 0
Similarly you can create code templates for other available options.
Other posts that come under Exploring SSMS
Enabling Save Changes
Enable/disable intellisense
Connecting to msdn forums or submitting your feedback to connect
Filtering object names
Changing Top N rows values
Copy results with header
Hiding System databases