由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - 如何让SQL 2005 CLR Trigger返回结果给Stored Procedure用?
相关主题
run SQL stored procedure from pythonSql Server有没有清除过期记录的有效办法?
In MySQL, 如何在procedure里create trigger?谢谢了?how to include record deleted date into trigger?
改写(migrate) stored proc 问题trigger vs. log ?
新手一问,关于delete和truncate tableforeign key reference to two tables? how to do it?
No Need for trigger Re: oracle trigger questionSQL debug step into a store procedure from another one (转载)
德州招SQL DeveloperSQL server Express 怎么加 link table
SQL Server stupid questionsMS T-SQL 问题
how to particially delete record in sql serveroracle trigger question
相关话题的讨论汇总
话题: delete话题: clr话题: table话题: trigger话题: stored
进入Database版参与讨论
1 (共1页)
a******8
发帖数: 46
1
(1) Apply following CLR Trigger when delete record from Table_1
For row to be deleted
Get associated tax from external file system.
(2) Delete_Stored_Procedure (non CLR)
DELETE from Table_1 where Year = 2008
问题是: CLR Trigger如何将Associated tax返回给Delete_Stored_Procedure?
谢谢!
j*****n
发帖数: 1781
2
Is trigger necessary? you can get associated tax for records being deleted
first and then delete.
a******8
发帖数: 46
3
Assume a couple of "delete" operation may appear:
- delete from Table_1 where Year = 2008
- delete from Table_1 where Year < 2008
- delete from Table_1 where Name = 'John'
Applying an trigger on delete is a simple & direct way.
p********l
发帖数: 279
4
Try to put into another table?
a******8
发帖数: 46
5
Yes. It should be ok to put result into another table then read it in stored
procedure. I'm wondering any other ways can help that.
j*****n
发帖数: 1781
6
hehe, 2k5 new feature....
OUTPUT clause
delete from Table_1
OUTPUT DELETED.*
where Year = 2008
B*****g
发帖数: 34098
7
你这个不还是要一个temp table吗?

【在 j*****n 的大作中提到】
: hehe, 2k5 new feature....
: OUTPUT clause
: delete from Table_1
: OUTPUT DELETED.*
: where Year = 2008

j*****n
发帖数: 1781
8
his SP could catch this data set itself, why need temp table?

【在 B*****g 的大作中提到】
: 你这个不还是要一个temp table吗?
a******8
发帖数: 46
9
I need get "TAX" information from external file system. How can T-SQL SP get
it? I think we can re-write CLR SP, but it'll involve a lot of changes -
that's I'm trying to avoid.
B*****g
发帖数: 34098
10
delete output can only get the deleted ids, then use this ids to get tax
from external source.

【在 j*****n 的大作中提到】
: his SP could catch this data set itself, why need temp table?
j*****n
发帖数: 1781
11
no idea about CLR SP... can you use xp_commandshell within your T-sql sp? it
might need higher privilege though.

get

【在 a******8 的大作中提到】
: I need get "TAX" information from external file system. How can T-SQL SP get
: it? I think we can re-write CLR SP, but it'll involve a lot of changes -
: that's I'm trying to avoid.

B*****g
发帖数: 34098
12
1. delete output
2. CLR user defined function (input id list)
get tax in function.
return id+tax list

it

【在 j*****n 的大作中提到】
: no idea about CLR SP... can you use xp_commandshell within your T-sql sp? it
: might need higher privilege though.
:
: get

j*****n
发帖数: 1781
13


【在 B*****g 的大作中提到】
: 1. delete output
: 2. CLR user defined function (input id list)
: get tax in function.
: return id+tax list
:
: it

a******8
发帖数: 46
14
THX!
1 (共1页)
进入Database版参与讨论
相关主题
oracle trigger questionNo Need for trigger Re: oracle trigger question
MySQL Server 2k Question again!德州招SQL Developer
Stored Procedure / Trigger - 谢谢SQL Server stupid questions
Trigger questionshow to particially delete record in sql server
run SQL stored procedure from pythonSql Server有没有清除过期记录的有效办法?
In MySQL, 如何在procedure里create trigger?谢谢了?how to include record deleted date into trigger?
改写(migrate) stored proc 问题trigger vs. log ?
新手一问,关于delete和truncate tableforeign key reference to two tables? how to do it?
相关话题的讨论汇总
话题: delete话题: clr话题: table话题: trigger话题: stored