Create a duplicate table in MS SQL

Ever wanted to replicate a table and its contents in MS SQL?

heres how:

SELECT * INTO NewTable FROM OldTable

Want to copy just the structure and not the content?

SELECT TOP 0 * INTO NewTable from OldTable

3 Responses to “Create a duplicate table in MS SQL”

  1. @sundhas, can you please show us what sort of query you ran?

  2. It doesnt work at my end :(
    It says : Sysntax error : INTO clause is not allowed
    what to do?

  3. :) It works! Thank you. I love this kind of tip.