调用包含更新语句的StoreProcedute

编程入门 行业动态 更新时间:2024-10-22 12:26:36
本文介绍了调用包含更新语句的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

本文发布于:2023-11-17 03:05:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1608586.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:语句   StoreProcedute

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!