Stored procedure
I want to create a stored procedure where the procedure will select only selected columns from tables and merge into single output how can i do it? Please give some example...Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vikram AgrawalPosted Mar 18, 2015, 5:26 AM
Hi Anjali,
try this
Create Procedure MyProc
As
Begin
Select Column1 + ', ' + Column2 + ', ' + Column3 From MyTable
End
Khargesh RajputPosted Mar 18, 2015, 5:05 AM
then write stored procedure
create proc sp_multi
as
begin
select (col1+,+col2+,col3) as output from table
end
write query for your table and columns
Anjali CPosted Mar 18, 2015, 4:52 AM
Khargesh RajputPosted Mar 18, 2015, 4:22 AM
select (column1+'-'+column2) as multicol from tablename