----------------------------------------------------------------
--                                                              
--  File:   Drop_Tables_Scaling.SQL                             
--          Microsoft TPC-E Benchmark Kit Ver. 1.14.0-1031      
--          Copyright Microsoft, 2008-2015                  
--                                                              
----------------------------------------------------------------
USE tpce
GO

---
--- Set connection attributes
---
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
SET ARITHABORT ON
SET CONCAT_NULL_YIELDS_NULL ON
SET QUOTED_IDENTIFIER ON
SET NUMERIC_ROUNDABORT OFF
GO

-- ***************************
-- *** DROP SCALING TABLES ***
-- ***************************
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'ACCOUNT_PERMISSION' )
	DROP TABLE ACCOUNT_PERMISSION
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'ADDRESS' )
	DROP TABLE ADDRESS
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'BROKER' )
	DROP TABLE BROKER
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'COMPANY' )
	DROP TABLE COMPANY
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'COMPANY_COMPETITOR' )
	DROP TABLE COMPANY_COMPETITOR
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'CUSTOMER' )
	DROP TABLE CUSTOMER
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'CUSTOMER_ACCOUNT' )
	DROP TABLE CUSTOMER_ACCOUNT
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'CUSTOMER_TAXRATE' )
	DROP TABLE CUSTOMER_TAXRATE
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'DAILY_MARKET' )
	DROP TABLE DAILY_MARKET
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'FINANCIAL' )
	DROP TABLE FINANCIAL
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'LAST_TRADE' )
	DROP TABLE LAST_TRADE
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'NEWS_ITEM' )
	DROP TABLE NEWS_ITEM
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'NEWS_XREF' )
	DROP TABLE NEWS_XREF
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'SECURITY' )
	DROP TABLE SECURITY
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'WATCH_ITEM' )
	DROP TABLE WATCH_ITEM
GO
IF EXISTS ( SELECT name FROM sysobjects WHERE name = 'WATCH_LIST' )
	DROP TABLE WATCH_LIST
GO
