Saturday, February 25, 2012

deploying a database

what is the easiest way to deploy a database for a webapp? i have create table scripts but waht is the easiest way to go about inserting data into lookup tables? would i have to write insert statements or is there some other way to do it

I use two different methods when I create lookup tables.

1) Manually type into the table the data

2) Create a script file which I run in query analyzer. Here is a sample of one the scripts I write:

create table [tbl_LookupCategory]

([int_CategoryID] int NOT NULL Primary Key,
[str_Category] nvarchar(20) Not NULL)

/* Insert the data into the table */

INSERT INTO [tbl_LookupCategory]
( [int_CategoryID],
[str_Category]
)


VALUES
( 1, 'Shirt' )

INSERT INTO [tbl_LookupCategory]
( [int_CategoryID],
[str_Category]
)
VALUES
( 2, 'Hat' )

|||

You can also use copy database wizard to copy your database to other servers.

No comments:

Post a Comment