如何创建一个可以改变另一个存储过程值的存储过程......? [英] How to create a stored procedure that can alter another stored procedure value......?
本文介绍了如何创建一个可以改变另一个存储过程值的存储过程......?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是新的PLZ ..用例子解释----
创建proc proc1
as
开始
从tableA中选择P_ID,P_Type,Artist_ID,其中年份BETWEEN 2012和DATEPART(年,getdate())
结束
I'm new plz.. Explain with Example ----
create proc proce1
as
Begin
select P_ID,P_Type,Artist_ID from tableA where Year BETWEEN 2012 AND DATEPART(year,getdate())
End
create proc proce2
@year varchar(20)
as
begin
exec ('alter proc proce1
as
Begin
select P_ID,P_Type,Artist_ID from tableA where Year BETWEEN @year AND DATEPART(year,getdate())
End')
end
I want to change year... Is it possible or not....?
thanks.... :)
推荐答案
从编码的角度来看,没有问题。
但是,如果您的存储过程没有修改权限,则会遇到问题。
There is no problem in doing this from a coding perspective.
However, if your stored procedure does not have modification rights, you will run into issues.
这篇关于如何创建一个可以改变另一个存储过程值的存储过程......?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文