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 :: mysql get auto_increment value 
Sql :: arithmetic expression in sql 
Sql :: mysql with docker 
Sql :: sql server port number 
Sql :: auto increment psql not primary key 
Sql :: add column mysql 
Sql :: load a log file in that format into MySQL 
Sql :: update or insert sql 
Sql :: execution time of mysql query 
Sql :: online sql compiler 
Sql :: sql select distinct 
Sql :: SQL Delete and Truncate Rows 
Sql :: can you write relational algebra into sql queries 
Sql :: sql example 
Sql :: if mysql UPDATE 
Sql :: postgresql replace html tags from string 
Sql :: salesforce soql get parents without children 
Sql :: nosqlbooster query other collection 
Sql :: how to order result of subquery in select 
Sql :: sql mod even odd 
Sql :: how to connect docker container to gcp sql server 
Sql :: list enums sql 
Sql :: sql database column values restrict 
Sql :: mysql replication change database name 
Sql :: save single sql query result boolean spring boot 
Sql :: downgrading sql localdb visual studio 
Sql :: mysql check if entry exists 
Sql :: error infor in sql server 
Sql :: select count(*) from table 
Sql :: kimball data warehouse sql calendar 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =