473,320 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to create a new database

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
Sep 26 '08 #1
2 935
I'm sorry I sent this to the wrong NG.
"_Who" <Ca**********@roadrunner.comwrote in message
news:uC**************@TK2MSFTNGP05.phx.gbl...
>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

Sep 26 '08 #2
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.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"_Who" <Ca**********@roadrunner.comwrote in message
news:uC**************@TK2MSFTNGP05.phx.gbl...
>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
Sep 26 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I...
5
by: Frank van Vugt | last post by:
Hi, I noticed that when using the single commandline: drop database <name>; create database <name>; this sometimes fails due to a pg_autovacuum process running on the background. When...
4
by: intl04 | last post by:
How do I create a data input form in Access that is external to the Access database to which it's connected (if that's possible, which I believe it is)? For example, if someone clicks on an Access...
1
by: intl04 | last post by:
I am getting strange print-related error messages when trying to create (not print!) reports. For example, when I click 'new' to create a report then choose 'design view', I get an error message...
9
by: Peter | last post by:
Hello£¬everyone, My program will collect a testing machine's data ,save the data and deal with the data everyday. I want to use vb.net to create database, add and delete tables or modify the...
14
by: mistral | last post by:
Need php script to create mySQL database programmatically; since hosting configuration may not allow create database from script, script also need eliminate/rewrite all restrictions in appropriate...
27
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
10
by: AAaron123 | last post by:
I want to create a database with one table on the host. I can't user SQL Server Management Studio to do it so I guess I have to do it programmatically. I have in mind that in the session start...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.