Copy table with index and statistics

  • Copy table with index and statistics,is anyone knows how I can copy table with indexes and statistics with another name

  • Krasavita (1/14/2010)


    Copy table with index and statistics,is anyone knows how I can copy table with indexes and statistics with another name

    Maybe it can be done with other alternatives, but the one that I know is copy Database in the new one!

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • Do you need to copy data too?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • no

  • Krasavita (1/14/2010)


    Copy table with index and statistics,is anyone knows how I can copy table with indexes and statistics with another name

    ...also with no data...any reason why do you need that!?

    copying database at all an another location then using import that table with different name...let me know if it works!

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • You can script out the table and its indexes from SSMS. As for the statistics, you should leave that to the DB Engine.

    Once you script your table, change the table name - then execute the script on the new server.

    Alternative method, Use RedGate SQL Compare - you can create the table on the destination and then alter the table name after the table is created there.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 6 posts - 1 through 5 (of 5 total)

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