Link to home
Start Free TrialLog in
Avatar of anusdesai
anusdesai

asked on

how to Create scripts with sql 2005 to create table and fields and also to add fields to existing tables ....

Hi Experts,
 how to Create scripts with sql 2005 to create table and fields and also to add fields to  existing tables .


Regards.
Avatar of Aneesh
Aneesh
Flag of Canada image

create table PutSomeTableNameHere ( field1  varchar(100), filed2 int, field3  bit)

in order to alter the existing tables use


ALTER TABLE putTableName
ADD someOtherColumn  int
Avatar of anusdesai
anusdesai

ASKER

This to to create table..but hoew to generate script of this so that my client can run on his machine to create tables in his database....
with SQL Server, you can open Enterprise Manager, drill down to the Table level, the Right Click on each table, and choose Generate SQL Script - this will generate the necessary SQL to create the Table Schema, when executed on as New SQL Server instance.

Is that what you are after?

AW
ASKER CERTIFIED SOLUTION
Avatar of kpcurley
kpcurley

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
be right back.....