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

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -