How to create a new database

W

_Who

I have a script that configures a database as I need it.

Here is a little bit of it:
CREATE TABLE [Albums] (
[AlbumID] [int] IDENTITY (1, 1) NOT NULL ,
[Caption] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[IsPublic] [bit] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [Photos] (
[PhotoID] [int] IDENTITY (1, 1) NOT NULL ,
[AlbumID] [int] NOT NULL ,
[Caption] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[BytesOriginal] [image] NOT NULL ,
[BytesFull] [image] NOT NULL ,.........

But it does not include code to create the database.

Shouldn't I add something like:

CREATE DATABASE "C:\test1.MDF"
GO

at the top
 
C

Cowboy \(Gregory A. Beamer\)

If you are using Enterprise Manager, you will have to right click the
database and create the create script.

One great tool to look at is the Database Publishing Wizard. It is a free
download and can even copy your seed data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top