IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'specdb')
	DROP DATABASE [specdb]
GO

CREATE DATABASE [specdb]  ON (NAME = N'specdb_Data', FILENAME = N'D:\SQLServer\Data\specdb_Data.MDF' , SIZE = 640, FILEGROWTH = 10%) LOG ON (NAME = N'specdb_Log1', FILENAME = N'E:\Raw1\' , SIZE = 6144, FILEGROWTH = 10%), (NAME = N'specdb_lLog2', FILENAME = N'E:\Raw2\' , SIZE = 6144, FILEGROWTH = 10%)
GO
ALTER DATABASE [specdb] ADD FILEGROUP [C_CUST_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'C_CUST', FILENAME = N'D:\SQLServer\Data\C_CUST_Data.NDF' , SIZE = 300, FILEGROWTH = 10%) TO FILEGROUP [C_CUST_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [C_PARTS_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'C_PARTS', FILENAME = N'D:\SQLServer\Data\C_PARTS_Data.NDF' , SIZE = 40, FILEGROWTH = 10%) TO FILEGROUP [C_PARTS_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [C_SITE_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'C_SITE', FILENAME = N'D:\SQLServer\Data\C_SITE_Data.NDF' , SIZE = 40, FILEGROWTH = 10%) TO FILEGROUP [C_SITE_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [C_SUPP_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'C_SUPP', FILENAME = N'D:\SQLServer\Data\C_SUPP_Data.NDF' , SIZE = 40, FILEGROWTH = 10%) TO FILEGROUP [C_SUPP_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [M_BOM_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'M_BOM', FILENAME = N'D:\SQLServer\Data\M_BOM_Data.NDF' , SIZE = 100, FILEGROWTH = 10%) TO FILEGROUP [M_BOM_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [M_INV_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'M_INV', FILENAME = N'D:\SQLServer\Data\M_INV_Data.NDF' , SIZE = 100, FILEGROWTH = 10%) TO FILEGROUP [M_INV_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [M_LARGORDER_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'M_LARGORDER', FILENAME = N'D:\SQLServer\Data\M_LARGORDER_Data.NDF' , SIZE = 1000, FILEGROWTH = 10%) TO FILEGROUP [M_LARGORDER_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [M_PARTS_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'M_PARTS', FILENAME = N'D:\SQLServer\Data\M_PARTS_Data.NDF' , SIZE = 60, FILEGROWTH = 10%) TO FILEGROUP [M_PARTS_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [M_WO_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'M_WRKORDER', FILENAME = N'D:\SQLServer\Data\M_WRKORDER_Data.NDF' , SIZE = 1000, FILEGROWTH = 10%) TO FILEGROUP [M_WO_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [O_CUST_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'O_CUST', FILENAME = N'D:\SQLServer\Data\O_CUST_Data.NDF' , SIZE = 300, FILEGROWTH = 10%) TO FILEGROUP [O_CUST_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [O_ITEM_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'O_ITEM', FILENAME = N'D:\SQLServer\Data\O_ITEM_Data.NDF' , SIZE = 40, FILEGROWTH = 10%) TO FILEGROUP [O_ITEM_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [O_ORDL_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'O_ORDL', FILENAME = N'D:\SQLServer\Data\O_ORDL_Data.NDF' , SIZE = 1000, FILEGROWTH = 10%) TO FILEGROUP [O_ORDL_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [O_ORDS_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'O_ORDS', FILENAME = N'D:\SQLServer\Data\O_ORDS_Data.NDF' , SIZE = 1000, FILEGROWTH = 10%) TO FILEGROUP [O_ORDS_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [S_COMP_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'S_COMP', FILENAME = N'D:\SQLServer\Data\S_COMP_Data.NDF' , SIZE = 90, FILEGROWTH = 10%) TO FILEGROUP [S_COMP_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [S_PO_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'S_PO', FILENAME = N'D:\SQLServer\Data\S_PO_Data.NDF' , SIZE = 90, FILEGROWTH = 10%) TO FILEGROUP [S_PO_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [S_SITE_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'S_SITE', FILENAME = N'D:\SQLServer\Data\S_SITE_Data.NDF' , SIZE = 20, FILEGROWTH = 10%) TO FILEGROUP [S_SITE_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [S_SUPP_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'S_SUPP', FILENAME = N'D:\SQLServer\Data\S_SUPP_Data.NDF' , SIZE = 20, FILEGROWTH = 10%) TO FILEGROUP [S_SUPP_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [S_SC_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'S_SUPPCOMP', FILENAME = N'D:\SQLServer\Data\S_SUPPCOMP_Data.NDF' , SIZE = 90, FILEGROWTH = 10%) TO FILEGROUP [S_SC_GROUP]
GO
ALTER DATABASE [specdb] ADD FILEGROUP [U_TABLES_GROUP] 
GO
ALTER DATABASE [specdb] ADD FILE(NAME = N'U_TABLES', FILENAME = N'D:\SQLServer\Data\U_TABLES_Data.NDF' , SIZE = 10, FILEGROWTH = 10%) TO FILEGROUP [U_TABLES_GROUP]
GO

exec sp_dboption N'specdb', N'autoclose', N'false'
GO

exec sp_dboption N'specdb', N'bulkcopy', N'false'
GO

exec sp_dboption N'specdb', N'trunc. log', N'false'
GO

exec sp_dboption N'specdb', N'torn page detection', N'true'
GO

exec sp_dboption N'specdb', N'read only', N'false'
GO

exec sp_dboption N'specdb', N'dbo use', N'false'
GO

exec sp_dboption N'specdb', N'single', N'false'
GO

exec sp_dboption N'specdb', N'autoshrink', N'false'
GO

exec sp_dboption N'specdb', N'ANSI null default', N'false'
GO

exec sp_dboption N'specdb', N'recursive triggers', N'false'
GO

exec sp_dboption N'specdb', N'ANSI nulls', N'false'
GO

exec sp_dboption N'specdb', N'concat null yields null', N'false'
GO

exec sp_dboption N'specdb', N'cursor close on commit', N'false'
GO

exec sp_dboption N'specdb', N'default to local cursor', N'false'
GO

exec sp_dboption N'specdb', N'quoted identifier', N'false'
GO

exec sp_dboption N'specdb', N'ANSI warnings', N'false'
GO

exec sp_dboption N'specdb', N'auto create statistics', N'true'
GO

exec sp_dboption N'specdb', N'auto update statistics', N'true'
GO

use [specdb]
GO

