rgb192
asked on
see all info for table in sql server
want to recreate table using command
while posting questions , could you please give some details ? its really hard for us to find what exctly your need is ?
>want to recreate table using command
Use a CREATE TABLE statement
>want to recreate table using command
Use a CREATE TABLE statement
in management studio.. navigate to the table you want to script out and right click on it then.
Script Table as -> Create To -> New Query Editor Window.
now you have the script to recreate it in another db or rename and create in the same db..
Script Table as -> Create To -> New Query Editor Window.
now you have the script to recreate it in another db or rename and create in the same db..
I agree with aneesh...your recent questions have been very vague. We're here to help, and we want to, but we can't read minds. The more detail you give us, the more likely we can help you.
Tim the astrologer :)
ASKER
sorry
for example
my database has a table 'person'
i want to get this output so i can create a similar table
CREATE TABLE person
(
num INT NOT NULL ,
firstname VARCHAR(20) NULL ,
lastname VARCHAR(30) NULL ,
gender_code VARCHAR(1) NULL ,
birth_dttm DATETIME NULL ,
inactive_date DATETIME NULL ,
CONSTRAINT PK_Person PRIMARY KEY CLUSTERED (num ASC) ON [PRIMARY]
)
GO
for example
my database has a table 'person'
i want to get this output so i can create a similar table
CREATE TABLE person
(
num INT NOT NULL ,
firstname VARCHAR(20) NULL ,
lastname VARCHAR(30) NULL ,
gender_code VARCHAR(1) NULL ,
birth_dttm DATETIME NULL ,
inactive_date DATETIME NULL ,
CONSTRAINT PK_Person PRIMARY KEY CLUSTERED (num ASC) ON [PRIMARY]
)
GO
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
works
from oldtable