Table Properties export

  • When I export tables to a different DB the properties (Index/Key, etc.) don't follow. Is there a workaround for this? And can I overwrite the table in the target DB, instead of deleting the tables before performing the export process? Thx in advance ...

  • How are you performing this? Are you using just the Import/ Export Wizard or using script table and move it manually?

    You would be better if you are using the generate scripts task (Rt click the database and in tasks, you find it and there you can select your table(s) and when generating scripts, you can additionally choose to generate Drop if existing, generate Index(es), other constraints etc...

    Actually if you have SQL Server 2008 SSMS (not the Server, only your SSMS as 2008), you can even script the table, its properties, indexes etc along with that, the data also, so what happens is that you have a insert into table statement also scripted, which can be used.


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • If you want the indexes and such to follow, you should script it out and execute that script on the destination. Another option is to use a tool Such as RedGate SQL Compare.

    Otherwise, an import/export operation is typically the data.

    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

  • Sorry... posted to the wrong thread...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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