📄 truncatetables.sql
字号:
/******************************************************************************
** File: TruncateTables.sql
** Name: Benchmark Data Load
** Desc: Remove the current data from the database in preparation
** for the benchmark data load. If you want to restore the
** original data, please see the DataPopulation.sql SQL script
** (located in the Create Scripts folder).
**
** Date: 11/6/2001
**
*******************************************************************************/
-- delete the contents of the Product table
PRINT 'Deleting Data: Product Table';
ALTER TABLE Item NOCHECK CONSTRAINT FK_Item_Product;
ALTER TABLE Product NOCHECK CONSTRAINT FK_Product_Category;
DELETE FROM Product
ALTER TABLE Product CHECK CONSTRAINT FK_Product_Category;
ALTER TABLE Item CHECK CONSTRAINT FK_Item_Product;
-- delete the contents of the Item table
PRINT 'Deleting Data: Item Table';
ALTER TABLE Item NOCHECK CONSTRAINT FK_Item_Product;
ALTER TABLE Item NOCHECK CONSTRAINT FK_Item_Supplier;
DELETE FROM Item
ALTER TABLE Item CHECK CONSTRAINT FK_Item_Supplier;
ALTER TABLE Item CHECK CONSTRAINT FK_Item_Product;
-- delete the contents of the Inventory table
TRUNCATE TABLE Inventory
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -