I have to write a select query with concatenating the stored procedure Exec in the select results.
This is the actual stored procedure execution result
exec wf_Move_bills ''' + billid+ ''',361,14098,14100, ''+ binid +'' ,''' + @comment + '''
BinId is an Integer. I am having trouble on concatenating with my query.
Result is returned as:
exec wf_Move_bills 'XZ242344',361,14098,14100, '+ binid +' ,'Moved by Dev :'
Expected result is:
exec wf_Move_bills 'XZ242344',361,14098,14100, 300 ,'Moved by Dev :'
Because in the stored procedure, parameter for binid is int with length = 4
declare @comment nvarchar(4000)
set @comment= 'Moved by Dev:'
select
*,
'exec wf_Move_bills ''' + billid+ ''',361,14098,14144, ''+ binid +'' ,''' + @comment + ''' '
from
billingtable