Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql server output parameter

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

sql 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 clear screen 
Sql :: clear screen command on mysql 
Sql :: mysql command not working in linux 
Sql :: drop multiple columns in sql 
Sql :: string to sql timestamp 
Sql :: select new table sql 
Sql :: mysql set last_insert_id 
Sql :: mysql datetime to date 
Sql :: database dump mysql command 
Sql :: vowels in sql 
Sql :: mysql between 
Sql :: postgresql resolv duplicate value violates unique constraint 
Sql :: date sql get the last week count 
Sql :: postgres : ERROR: division by zero 
Sql :: sql server information_schema temp tables 
Sql :: postgres select as csv 
Sql :: sql delete all values in a column 
Sql :: use float in sql server string 
Sql :: oracle sql drop column if exists 
Sql :: How to add a Try/Catch to SQL Stored Procedure 
Sql :: get time component of datetime sql 
Sql :: postgresql function 
Sql :: Postgres - Login and connect as default user 
Sql :: creating a table sql 
Sql :: drop a view in sqlite 
Sql :: SQL Server Altering Column to be Unique 
Sql :: mysql order by two columns priority 
Sql :: mssql datetime to date 
Sql :: data formate in sql 
Sql :: null value in column violates not-null constraint 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =