• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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