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

后端 未结 3 576
深忆病人
深忆病人 2020-12-19 13:53

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

3条回答
  •  情书的邮戳
    2020-12-19 14:43

    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 
    exec master.sys.xp_cmpshell 'C:\storedProc.bat'
    ....
    ....
    
    return @return
    end
    

    More on xp_cmpshell on MSDN.

提交回复
热议问题