I have following script. I dont know how to create new database in sql server 2005. I run following scirpt, and it create tables under model instead of seperate databse. it look massy.
how can i create seperate databse. I am copy some script here for your adive and course of action.
-----------------------------------------------------------
-- SQL Server 2000 Bible
-- Hungry Minds
-- Paul Nielsen
-- OBX Kites sample database - CREATE Database, Tables, and Procs
-- this script will drop an existing OBXKites database
-- and create a fresh new installation
-- related scripts:
-- OBXKites_Populate
-- T-SQL KEYWORDS go
-- DatabaseNames
-----------------------------------------------------------
-----------------------------------------------------------
-- Drop and Create Database
USE master
GO
IF EXISTS (SELECT * FROM SysDatabases WHERE NAME='OBXKites')
DROP DATABASE OBXKites
go
-- This creates 1 database that uses 2 filegroups
CREATE DATABASE OBXKites
ON PRIMARY
(NAME = 'OBXKites', FILENAME = 'D:\SQLData\OBXKites.mdf'),
FILEGROUP Static
(NAME = 'OBXKitesStatic', FILENAME = 'c:\SQLData\OBXKitesStatic.ndf')
LOG ON (NAME = 'OBXKitesLog', FILENAME = 'c:\SQLData\OBXKites.ldf')
go
-- set to Full Log
go
SET QUOTED_IDENTIFIER ON
go
USE OBXKites
go
-----------------------------------------------------------
-----------------------------------------------------------
-- Create Tables, in order from primary to secondary
CREATE TABLE dbo.OrderPriority (
OrderPriorityID UNIQUEIDENTIFIER NOT NULL ROWGUIDCOL DEFAULT (NEWID()) PRIMARY KEY NONCLUSTERED,
OrderPriorityName NVARCHAR (15) NOT NULL,
OrderPriorityCode NVARCHAR (15) NOT NULL,
Priority INT NOT NULL
)
ON [Static]
go