Thursday, November 15, 2012

How to call a stored procedure from a user defined function In SQL 2000


PROBLEM

How to call a stored procedure from a user defined function In SQL 2000


SOLUTION

Either you need to modify your stored procedure to be a user defined function or the other way around.
One crude way to achieve what you are looking for is to have your exec statement in a batch script and call that batch script from your function. Something like this -
create function <functionName>
exec master.sys.xp_cmpshell 'C:\storedProc.bat'
....
....

return @return
end
I hope this helps.

No comments:

Post a Comment