没有合适的资源?快使用搜索试试~ 我知道了~
数据表修改语法
需积分: 11 0 下载量 116 浏览量
2013-12-22
14:38:26
上传
评论
收藏 5KB TXT 举报
温馨提示
试读
6页
数据表修改语法
资源推荐
资源详情
资源评论
********************************************************************************************************
--消耗品种类字典 UT_GOODS_DICT_KIND
--alter table UT_GOODS_DICT_KIND add n_last numeric(18,0) null;
go
alter TRIGGER tr_DICT_KIND_n_last ON UT_GOODS_DICT_KIND for UPDATE
AS
BEGIN
begin transaction
update UT_GOODS_DICT_KIND set UT_GOODS_DICT_KIND.n_last = isnull(UT_GOODS_DICT_KIND.n_last,0) + 1
from UT_GOODS_DICT_KIND inserted
where UT_GOODS_DICT_KIND.GOODS_KIND_CODE = inserted.GOODS_KIND_CODE;
if (@@error <> 0)
begin
rollback transaction;
return;
end;
commit transaction;
END;
--消耗品明细字典 UT_GOODS_DICT_ITEMS
--alter table UT_GOODS_DICT_ITEMS add n_last numeric(18,0) null;
go
alter TRIGGER tr_DICT_ITEMS_n_last ON UT_GOODS_DICT_ITEMS for UPDATE
AS
BEGIN
begin transaction
update UT_GOODS_DICT_ITEMS set UT_GOODS_DICT_ITEMS.n_last = isnull(UT_GOODS_DICT_ITEMS.n_last,0) + 1
from UT_GOODS_DICT_ITEMS inserted
where UT_GOODS_DICT_ITEMS.GOODS_CODE = inserted.GOODS_CODE;
if (@@error <> 0)
--消耗品种类字典 UT_GOODS_DICT_KIND
--alter table UT_GOODS_DICT_KIND add n_last numeric(18,0) null;
go
alter TRIGGER tr_DICT_KIND_n_last ON UT_GOODS_DICT_KIND for UPDATE
AS
BEGIN
begin transaction
update UT_GOODS_DICT_KIND set UT_GOODS_DICT_KIND.n_last = isnull(UT_GOODS_DICT_KIND.n_last,0) + 1
from UT_GOODS_DICT_KIND inserted
where UT_GOODS_DICT_KIND.GOODS_KIND_CODE = inserted.GOODS_KIND_CODE;
if (@@error <> 0)
begin
rollback transaction;
return;
end;
commit transaction;
END;
--消耗品明细字典 UT_GOODS_DICT_ITEMS
--alter table UT_GOODS_DICT_ITEMS add n_last numeric(18,0) null;
go
alter TRIGGER tr_DICT_ITEMS_n_last ON UT_GOODS_DICT_ITEMS for UPDATE
AS
BEGIN
begin transaction
update UT_GOODS_DICT_ITEMS set UT_GOODS_DICT_ITEMS.n_last = isnull(UT_GOODS_DICT_ITEMS.n_last,0) + 1
from UT_GOODS_DICT_ITEMS inserted
where UT_GOODS_DICT_ITEMS.GOODS_CODE = inserted.GOODS_CODE;
if (@@error <> 0)
begin
rollback transaction;
return;
end;
commit transaction;
END;
--货源单位字典 UT_GOODS_FACTORY
--alter table UT_GOODS_FACTORY add n_last numeric(18,0) null;
go
alter TRIGGER tr_GOODS_FACTORY_n_last ON UT_GOODS_FACTORY for UPDATE
AS
BEGIN
begin transaction
update UT_GOODS_FACTORY set UT_GOODS_FACTORY.n_last = isnull(UT_GOODS_FACTORY.n_last,0) + 1
from UT_GOODS_FACTORY inserted
where UT_GOODS_FACTORY.FACTORY_CODE = inserted.FACTORY_CODE;
if (@@error <> 0)
begin
rollback transaction;
return;
end;
commit transaction;
END;
--仪器消耗参数设置 UT_GOODS_DICT_REAGENT
--alter table UT_GOODS_DICT_REAGENT add id_shared numeric(18,0) null;
rollback transaction;
return;
end;
commit transaction;
END;
--货源单位字典 UT_GOODS_FACTORY
--alter table UT_GOODS_FACTORY add n_last numeric(18,0) null;
go
alter TRIGGER tr_GOODS_FACTORY_n_last ON UT_GOODS_FACTORY for UPDATE
AS
BEGIN
begin transaction
update UT_GOODS_FACTORY set UT_GOODS_FACTORY.n_last = isnull(UT_GOODS_FACTORY.n_last,0) + 1
from UT_GOODS_FACTORY inserted
where UT_GOODS_FACTORY.FACTORY_CODE = inserted.FACTORY_CODE;
if (@@error <> 0)
begin
rollback transaction;
return;
end;
commit transaction;
END;
--仪器消耗参数设置 UT_GOODS_DICT_REAGENT
--alter table UT_GOODS_DICT_REAGENT add id_shared numeric(18,0) null;
剩余5页未读,继续阅读
资源评论
hylanthony
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功