Collections:
Passing Values to Stored Procedure Parameters in SQL Server
How To Provide Values to Stored Procedure Parameters in SQL Server Transact-SQL?
✍: FYIcenter.com
If a stored procedure is created with parameters, you need pass values to those parameters when calling the stored procedure with one of two formats listed below:
-- Passing values only EXEC procedure_name value_1, value_2, ... value_n; -- Passing name-value pairs EXEC procedure_name @parameter_1 = value_1, @parameter_2 = value_2, ... @parameter_n = value_n;
The tutorial exercise below shows 2 ways to pass values to stored procedure parameters:
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 EXEC Hello @url='dev.fyicenter.com'; GO Welcome to dev.fyicenter.com
⇒ Passing Name-Value Pairs as Parameters in SQL Server
⇐ Creating Stored Procedures with Parameters in SQL Server
2016-12-28, 1971🔥, 0💬
Popular Posts:
What Happens If the UPDATE Subquery Returns Multiple Rows in SQL Server? If a subquery is used in a ...
How To Use GO Command in "sqlcmd" in SQL Server? "sqlcmd" is a command line client application to ru...
How To Generate CREATE TABLE Script on an Existing Table in SQL Server? If you want to know how an e...
What Is a Dynamic Performance View in Oracle? Oracle contains a set of underlying views that are mai...
Collections: Interview Questions MySQL Tutorials MySQL Functions Oracle Tutorials SQL Server Tutoria...