本文介绍了调用包含更新语句的StoreProcedute的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我编写了存储过程,在其中使用了Update语句. 我想调用存储过程.对于插入并选择我已经完成,但无法进行更新. 我正在使用SQL Server 2000和Visual Studio2005. 有人可以帮我吗? 在此先感谢您.
I have written stored procedure in which i used Update Statement. I want to call stored procedure. For insert and select i have done but it''s not working for update. I am using sql server 2000 and visual studio 2005. Can any one help me? Thanks in advance.
推荐答案您调用的更新存储过程与任何其他存储过程完全相同,只需确保您传入所需的参数即可.没有区别.如果您使用的控件直接设置了Update语句,那么这些事情将毫无用处,只需编写一个适当的数据层并对其进行处理即可. You call an update stored proc exactly the same as any other stored proc, just making sure you pass in the required parameters. There is no difference. If you''re using a control that has you set up Update statements directly, those things are useless, just write a proper data layer and be done with it.
假设您有一个名为作为T1 列:Id,名称,地址 1d名称地址 1萨吉德454545 2参数565656 Suppose you have table named as T1 Columns:Id,Name,Address 1d Name Address 1 Sajid 454545 2 Param 565656 create proc UpdateName(@Name varchar(30),@Id int) as Update T1 set Name=@Name where Id=@Id
如何调用存储过程
How to call the Stored Procedure
exec UpdateName 'Sajid Shahsroha',1;
更多推荐
调用包含更新语句的StoreProcedute
发布评论