Collections:
Creating Stored Procedures with Parameters in SQL Server
How To Create Stored Procedures with Parameters in SQL Server Transact-SQL?
✍: FYIcenter.com
Very often, you need to create a stored procedure with one or more parameters. You only supply values to those parameters at the time of executing the stored procedure.
Stored procedures with parameters can be created with the following syntax:
CREATE PROCEDURE procedure_name @parameter_1 datatype, @parameter_2 datatype, ... @parameter_n datatype AS statement_1; statement_2; ... statement_n; GO
The following tutorial exercise shows you how to create a stored procedure with one parameter called @url:
USE FyiCenterData; GO DROP PROCEDURE Hello; GO CREATE PROCEDURE Hello @url nvarchar(40) AS PRINT 'Welcome to ' + @url; GO EXEC Hello 'dba.fyicenter.com'; GO Welcome to dba.fyicenter.com
⇒ Passing Values to Stored Procedure Parameters in SQL Server
⇐ "ALTER PROCEDURE" - Modifying Existing Stored Procedures in SQL Server
2017-01-05, 2129🔥, 0💬
Popular Posts:
How To Use SQL*Plus Built-in Timers in Oracle? If you don't have a stopwatch/timer and want to measu...
How To Convert a Unicode Strings to Non-Unicode Strings in SQL Server Transact-SQL? Since Unicode ch...
How To Break Query Output into Pages in MySQL? If you have a query that returns hundreds of rows, an...
How To Use "IF ... ELSE IF ..." Statement Structures in SQL Server Transact-SQL? "IF ... ELSE IF ......
What Are Out-of-Range Errors with DATETIME values in SQL Server Transact-SQL? When you enter DATETIM...