国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

創建CLR自定義觸發器-C#

2024-07-21 02:18:19
字體:
來源:轉載
供稿:網友


第一步:在visual studio 2005中編寫代碼
using system;
using system.data;
using system.data.sql;
using system.data.sqlserver;
using system.data.sqltypes;
public partial class triggers
{
// enter existing table or view for the target and uncomment the attribute line
// [sqltrigger (name="mytrigger", target="table1", event="for update")]
public static void mytrigger()
{
sqltriggercontext mytriggercontext = sqlcontext.gettriggercontext();
sqlpipe mypipe = sqlcontext.getpipe();
sqlcommand mycommand = sqlcontext.getcommand();
if (mytriggercontext.triggeraction == triggeraction.insert)
{
mycommand.commandtext = "select * from sptesttbl";
}
mypipe.execute(mycommand);
}
}

第二步:編譯,部署(build,deploy)
第三步:注冊到yukon
語法:
create trigger trigger_name on table_name for insert|update|delete
as external name assembly_name.class_name.clr_trigger_name

示例:
create trigger mytrigger on testtbl1 for insert
as external name udt.triggers.mytrigger


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 禄丰县| 瓮安县| 三原县| 上高县| 松潘县| 开化县| 云和县| 光山县| 杭锦后旗| 正镶白旗| 宿松县| 三明市| 天柱县| 新竹县| 喀喇| 广安市| 蓬安县| 湘乡市| 开鲁县| 康乐县| 封开县| 灌阳县| 三门县| 大悟县| 大名县| 利辛县| 富顺县| 武定县| 谷城县| 思南县| 安西县| 英超| 巫山县| 利川市| 镇赉县| 凤城市| 乃东县| 阿图什市| 通化市| 祁阳县| 桓仁|