Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

see all info for table in sql server

want to recreate table using command
Avatar of chapmandew
chapmandew
Flag of United States of America image

select * into newtable
from oldtable
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
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..  
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 :)
Avatar of rgb192

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
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

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
Avatar of rgb192

ASKER

works