-- 刪除所有表格 (依外鍵關聯逆序)
use [17168erp_demo]

-- Batch 7
DROP TABLE [dbo].[pro_order_record];

-- Batch 6
DROP TABLE [dbo].[RegionAndRoomAndBedSchedule];
DROP TABLE [dbo].[transfer_register];
DROP TABLE [dbo].[stock_files];
DROP TABLE [dbo].[accounting_files];
DROP TABLE [dbo].[bed_order_detail];

-- Batch 5
DROP TABLE [dbo].[ShuWen];
DROP TABLE [dbo].[GuaDanOrderGuest];
DROP TABLE [dbo].[AncestralTabletPositionRecord];
DROP TABLE [dbo].[project_sub];
DROP TABLE [dbo].[stock];
DROP TABLE [dbo].[accounting];
DROP TABLE [dbo].[bed_order];

-- Batch 4
DROP TABLE [dbo].[RegionRoomBed];
DROP TABLE [dbo].[AncestralTabletRegistrant];
DROP TABLE [dbo].[news_files];
DROP TABLE [dbo].[project];
DROP TABLE [dbo].[member_check];
DROP TABLE [dbo].[pro_order_detail];

-- Batch 3
DROP TABLE [dbo].[admin_log];
DROP TABLE [dbo].[Room];
DROP TABLE [dbo].[AncestralTabletPosition];
DROP TABLE [dbo].[news];
DROP TABLE [dbo].[activity_spares];
DROP TABLE [dbo].[activity_relating];
DROP TABLE [dbo].[activity_kind_detail];
DROP TABLE [dbo].[actItem_files];
DROP TABLE [dbo].[act_bom];
DROP TABLE [dbo].[GuaDanOrder];
DROP TABLE [dbo].[followers_tablet];
DROP TABLE [dbo].[family_members];
DROP TABLE [dbo].[activity_check];
DROP TABLE [dbo].[pro_order];
DROP TABLE [dbo].[member];

-- Batch 2
DROP TABLE [dbo].[Region];
DROP TABLE [dbo].[AncestralTabletArea];
DROP TABLE [dbo].[bed_kind_detail];
DROP TABLE [dbo].[supplier];
DROP TABLE [dbo].[activity];
DROP TABLE [dbo].[followers];
DROP TABLE [dbo].[actItem];
DROP TABLE [dbo].[admin];

-- Batch 1
DROP TABLE [dbo].[supplier_kind];
DROP TABLE [dbo].[stock_kind];
DROP TABLE [dbo].[project_kind];
DROP TABLE [dbo].[news_kind];
DROP TABLE [dbo].[member_title];
DROP TABLE [dbo].[member_group];
DROP TABLE [dbo].[bed_kind];
DROP TABLE [dbo].[appellation];
DROP TABLE [dbo].[activity_kind];
DROP TABLE [dbo].[activity_category_kind];
DROP TABLE [dbo].[actItem_kind];
DROP TABLE [dbo].[accounting_kind2];
DROP TABLE [dbo].[accounting_kind];
DROP TABLE [dbo].[GuadanTimeSetting];
DROP TABLE [dbo].[stock_reason];
DROP TABLE [dbo].[RegionType];
DROP TABLE [dbo].[RegionRoomBedStatus];
DROP TABLE [dbo].[AncestralTabletStatus];
DROP TABLE [dbo].[PostNumber];
DROP TABLE [dbo].[PostCity];
DROP TABLE [dbo].[item];
DROP TABLE [dbo].[files];
DROP TABLE [dbo].[country];
DROP TABLE [dbo].[company];
DROP TABLE [dbo].[admin_group];

-- Views
DROP VIEW [dbo].[法會統計];
DROP VIEW [dbo].[報名明細查詢];
