Home All Groups Group Topic Archive Search About
Author
23 Dec 2005 5:43 AM
TAHA
Hi All
how can I Create Table (COPY STRUCTURE TO TableName Only )  From Another
Table In The Same Database
Thanks

Author
22 Dec 2005 7:57 PM
Aaron Bertrand [SQL Server MVP]
SELECT *
    INTO newTable
    FROM oldTable
    WHERE 1 = 0;

Better yet, store your CREATE TABLE scripts in source control instead of
relying on this.  Because you will not get any indexes, constraints, keys,
identity properties, statistics, extended properties, etc.

A


Show quote
"TAHA" <TAHA***@HOTMAIL.COM> wrote in message
news:uUamQAzBGHA.344@TK2MSFTNGP11.phx.gbl...
> Hi All
> how can I Create Table (COPY STRUCTURE TO TableName Only )  From Another
> Table In The Same Database
> Thanks
>
>
>
Author
23 Dec 2005 6:06 AM
TAHA
Thank you Aaron

Show quote
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:OuEgpGzBGHA.984@tk2msftngp13.phx.gbl...
> SELECT *
>    INTO newTable
>    FROM oldTable
>    WHERE 1 = 0;
>
> Better yet, store your CREATE TABLE scripts in source control instead of
> relying on this.  Because you will not get any indexes, constraints, keys,
> identity properties, statistics, extended properties, etc.
>
> A
>
>
> "TAHA" <TAHA***@HOTMAIL.COM> wrote in message
> news:uUamQAzBGHA.344@TK2MSFTNGP11.phx.gbl...
>> Hi All
>> how can I Create Table (COPY STRUCTURE TO TableName Only )  From Another
>> Table In The Same Database
>> Thanks
>>
>>
>>
>
>

AddThis Social Bookmark Button