Hello, I have been working around this issue, but couldn't yet find any solution.
I have a stored procedure that calls a method to do a certain repetitive work.
In this function, I have a dynamic query, which means, that I am concatinating commands to the query depending on the input of the function.
for example, there is an input for a function called "Id"
Inside the function,
if Id = 111
I need to add " and ID <> 1" and if Id has another value I need to add " and ID = c.ID" something like that.
Now, inside the function, I need to return a value by executing the above @.SQLString as follows:
EXEC @.SQLString
When I need is something like
EXEC @.SQLString, @.Total Output
Return (@.Total)
Are there any ideas ?
regardsProblem Solved
regardssql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment