Copy the table structure

AA fate 20 Reputation points
2023-09-22T02:10:46.0166667+00:00

I have a table from a colleague. I want to create a table with the same structure as this one.

But I don't have a table creation statement, how do I do this?

Please suggest.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,629 questions
0 comments No comments
{count} votes

Accepted answer
  1. PercyTang-MSFT 12,501 Reputation points Microsoft Vendor
    2023-09-22T02:17:19.8466667+00:00

    Hi @AA fate

    Now I have a table.

    User's image

    You can use this.

    select * into newtable from test where 1 = 2;
    

    Output:

    User's image

    Best regards,

    Percy Tang


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.