
--
-- Imediately create the benchmark auxillary table.  This must be done here 
-- since the table will hold the LoadStartTime.
--

if exists ( select name from sysobjects where name = 'TPCH_AUX_TABLE' )
	drop table TPCH_AUX_TABLE

create table	TPCH_AUX_TABLE
	(
		updateset  integer,
		LoadStart  datetime,
		LoadFinish datetime,
		QgenSeed   integer
	)

--
-- Initialize the table and populate it with the start time from the
-- tpch_temp_timer we created earlier
--

declare	@LoadStartTime datetime
select	@LoadStartTime	= (	select	load_start_time
				from master.dbo.tpch_temp_timer
			  )

insert into TPCH_AUX_TABLE values( 1,  @LoadStartTime, 0, 0 )
GO

--
--  Now to clean-up after oursleves, drop the tpch_temp_timer table from Master 
--
drop table master.dbo.tpch_temp_timer
GO

--
--  Echo the load start time for auditability
--

select	LoadStart AS 'Load Started At'
from	TPCH_AUX_TABLE



