通过存储过程插入修改数据 [英] Insert Modify data through store procedure

查看:112
本文介绍了通过存储过程插入修改数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我正在制作一个Windows应用程序

我通过存储过程插入客户端信息并传递数据表

并通过out参数获取该id插入该客户端的其他详细信息。

它插入所有详细信息但是如果我想修改该客户端详细信息我应该怎么做。

hi I am making a windows application
I am inserting Client information through store procedure and passing data table
and taking that id through out parameter and inserting other details of that client.
It is inserting all details but If I want to modify that Client details how should i do.

推荐答案





你可以写另一个程序,或者你可以修改你现有的程序。



如果你发送ID null或一些默认值然后应该插入和输出ID值



如果你发送ID(非空或不是某些默认值)那么你应该更新通过
Hi,

You can write another procedure or you can can modify your existing one.

If you send ID null or some default value then that should insert and out the ID value

if you send ID( Not null or not some default value ) then you should update the row

by
update 

SQL这一行



并将Id放在where子句中。

SQL and put Id in where clause.


这篇关于通过存储过程插入修改数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆