shoppercart_proc.sql
来自「java sql jsp javabean」· SQL 代码 · 共 33 行
SQL
33 行
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 + =
减小字号Ctrl + -
显示快捷键?