vb.net - How to get count in output variable using a stored procedure? -
select count(*) tblrequest group requeststatusid
this query return column having total requests respective status id
.
i want total requests count respective statusid
in output variables using stored procedure.
this query return column having total requests respective status id.
i want total requests respective statusid in output variable using stored procedure.
i.e. returns column like
______________ |nonamecolumn| |------------| | 21 | | 6 | | 14 | |------------|
i want each row value in output variable separately (eg. set @pending=21, set @sent=6, set discarded=14 ), using stored procedure , vb.net code.
in simple words: how can row's values in variable sql server stored procedure?
create procedure countrequests @requests int output select @requests = count(*) tblrequest group requeststatusid
or select
select count(*) requests tblrequest group requeststatusid
Comments
Post a Comment