Duplicate table with the same structure

  • Hi,

    I've one table - tblStudent.

    What a simplest SQL Scripts to duplicate (no rows) tblStudent with the same structure?

  • 1.Open the table in Enterprise Manager (Design Mode) and Select all the Columns and paste it in to new table.

    2.Right Click the table and generate script (with Indexes and Keys). Paste the script in Query analyser and find and replace Old Table Name with new table name and execute the script.

    Hope this helps

    Thanks

    Sreejith

  • select * into duptable from tblstudent where 1=2


    Regards,

    Ganesh

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply