February 23, 2010 at 6:42 am
Hai Friends;
I need the following Structure of table ;
i have to create a table like this, only structure are created
SELECT * INTO tbl1FROM dbo.tbl2 WHERE 1=2,
I need the entire thing like primary Key and Indexes are moved to the tbl1; it's poosible means pls any one to help me;
Thanks;
A.Faijurrahuman
February 23, 2010 at 7:11 am
The structure of the table is described in the system tables (sysobjects, syscolumns, sysindexes etc.) you can roll your own tsql to extract the information into "create table..." statements, or you can use some scripts other have already written. Its really not that hard to do, it mostly takes patience. You will learn a lot about SQL server by doing it yourself.
The probability of survival is inversely proportional to the angle of arrival.
February 23, 2010 at 12:29 pm
The easiest way is to use SSMS. Right-click on the table, select Script Table AS -> CREATE TO -> New QUery window. Then change the table name in the script.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply