TipGiver
Programmer
- Sep 1, 2005
- 1,863
There is an old thread started by me: thread796-1205618
The database had only 2 tables. Below is shown what i got by using the ms-sql server management studo express, when i right clicked the table and selected script table as -> create to.
I would like to know: I want to create programmatically the database with the 2 tables
1. How? Do i have to save the 2 .sql files and somehow execute them?
2. The below starts with USE... which means that it will go search and find the db. By right clicking the database now, selecting script database as -> create to.
If i am correct, the .sql files should be 3. How do i execute these sql files? Furthermore.. how can i change the path?
TIA
The database had only 2 tables. Below is shown what i got by using the ms-sql server management studo express, when i right clicked the table and selected script table as -> create to.
I would like to know: I want to create programmatically the database with the 2 tables
1. How? Do i have to save the 2 .sql files and somehow execute them?
2. The below starts with USE... which means that it will go search and find the db. By right clicking the database now, selecting script database as -> create to.
If i am correct, the .sql files should be 3. How do i execute these sql files? Furthermore.. how can i change the path?
Code:
USE [D:\MY VISUAL BASIC.NET PROJECTS\EE3.2\ENTOLESELEGXOU3\ENTOLESELEGXOU\DATABASE.MDF]
GO
/****** Object: Table [dbo].[ComTable] Script Date: 01/15/2007 19:30:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ComTable](
[ID] [int] IDENTITY(1,1) NOT NULL,
[ReleaseDate] [nchar](10) COLLATE Latin1_General_CI_AI NULL,
[Kriteria] [nvarchar](100) COLLATE Latin1_General_CI_AI NULL,
[Observations] [nvarchar](300) COLLATE Latin1_General_CI_AI NULL,
[Checkers] [nvarchar](200) COLLATE Latin1_General_CI_AI NULL,
[BookDef] [nchar](1) COLLATE Latin1_General_CI_AI NULL,
[AA] [int] NULL,
CONSTRAINT [PK_ComTable] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
TIA