📄 shoppercart_proc.sql
字号:
use Shopper
go
-- Disable the constraint and Re-enable the constraint.
-- 删除小类的存储过程
if exists(select name from sysobjects where name = 'proc_delSmallCategory')
drop procedure proc_delSmallCategory
go
create procedure proc_delSmallCategory
@scid int
as
alter table Products nocheck constraint FK_Products_SmallCategory
update Products set SmallCID = 0 where SmallCID = @scid
delete from SmallCategory where SCID = @scid
alter table Products check constraint FK_Products_SmallCategory
go
-- Disable the constraint and Re-enable the constraint.
-- 删除大类的存储过程
if exists(select name from sysobjects where name = 'proc_delCategory')
drop procedure proc_delCategory
go
create procedure proc_delCategory
@cid int
as
alter table SmallCategory nocheck constraint FK_SmallCategory_Category
update SmallCategory set CID = 0 where CID = @cid
delete from Category where CID = @cid
alter table SmallCategory check constraint FK_SmallCategory_Category
go
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -