• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

see all info for table in sql server

want to recreate table using command
0
rgb192
Asked:
rgb192
  • 3
  • 2
  • 2
  • +1
1 Solution
 
chapmandewCommented:
select * into newtable
from oldtable
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
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
0
 
tigin44Commented:
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..  
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
chapmandewCommented:
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.
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
Tim the astrologer :)
0
 
rgb192Author Commented:
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
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
run this in a new query window

sp_Columns person
0
 
rgb192Author Commented:
works
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now