在sql server中触发。 [英] Trigger in sql server.

查看:75
本文介绍了在sql server中触发。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从另一个表中插入插入数据的值。

例如 -

有两个表A,B。

在C#页面的A中插入数据然后触发A是在B中插入数据然后如何获取B的标识行。

how to get inserted values of inserted data from another table.
for example -
There are two table A,B.
insert data in A from C# page and then trigger of A is insert data in B then how to get identity row of B.

推荐答案

看到:Triggers-Sql Server [ ^ ]它并不那么难。
See this : Triggers-Sql Server[^] Its not that hard.


因为你没有说明你想要的用这个。我可以为您的解决方案推荐两种不同的技术。



1. 触发器 [ ^ ]

页面底部有一些例子。



2. 输出条款 [ ^ ] - 假设您正在使用SQL 2005或更高版本。



再次在页面底部有一些示例。
As you haven't indicate how you want to use this. I can suggest 2 different techniques that you explore for your solution.

1. Triggers[^]
There are some examples at the bottom of the page.

2. Ouput clause[^] - assuming that you are using SQL 2005 or later.

Again there are some examples at the bottom of the page.


这篇关于在sql server中触发。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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