Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql stored procedure with output parameters

CREATE PROCEDURE uspFindProductByModel (
    @model_year SMALLINT,
    @product_count INT OUTPUT
) AS
BEGIN
    SELECT 
        product_name,
        list_price
    FROM
        production.products
    WHERE
        model_year = @model_year;

    SELECT @product_count = @@ROWCOUNT;
END;
Comment

output parameter use with stored procedure


        
            
        
     CREATE PROCEDURE uspFindProductByModel (
    @model_year SMALLINT,
    @product_count INT OUTPUT
) AS
BEGIN
    SELECT 
        product_name,
        list_price
    FROM
        production.products
    WHERE
        model_year = @model_year;

    SELECT @product_count = @@ROWCOUNT;
END;
Comment

ms sql server stored procedure output parameter

Copy CodeCREATE PROCEDURE spGetEmployeeCountByGender
@Gender nvarchar(20),
@EmployeeCount int Output
AS
BEGIN
SELECT @EmployeeCount = COUNT(Id) 
FROM tblEmployee 
WHERE Gender = @Gender
END
Comment

sql stored procedure output parameters

CREATE PROCEDURE uspFindProductByModel (
    @model_year SMALLINT,
    @product_count INT OUTPUT
) AS
BEGIN
    SELECT 
        product_name,
        list_price
    FROM
        production.products
    WHERE
        model_year = @model_year;

    SELECT @product_count = @@ROWCOUNT;
END;
Code language: SQL (Structured Query Language) (sql)
Comment

PREVIOUS NEXT
Code Example
Sql :: sql only five first row 
Sql :: mysql select update same table 
Sql :: n highest salary in sql 
Sql :: mysql export and import 
Sql :: mysql count with if 
Sql :: list of all table names in sql server databse 
Sql :: sql blank vs null 
Sql :: oracle sql pad left zeros 
Sql :: mysql update join 
Sql :: sql server select first day of previous year 
Sql :: oracle log files 
Sql :: install mysql 5.7 
Sql :: write sql query to find the second highest salary of employee 
Sql :: joomla execute raw sql 
Sql :: oracle tablespace tables list 
Sql :: remove space in sql server 2012 
Sql :: postgres set null 
Sql :: oracle apex view logs 
Sql :: ascending order and where in sql 
Sql :: sql counter column 
Sql :: empty table sqlite 
Sql :: Create table Statement Syntax in SQL Server 
Sql :: install postgresql 10 centos 7 
Sql :: dual in db2 
Sql :: postgres update multiple columns 
Sql :: sql server previous month 
Sql :: mysql order by multiple columns 
Sql :: change password postgres pgserver 
Sql :: sql server drop column 
Sql :: mysql function variable 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =