import data locate in file => file create with generate script

  • Hi expert :),

    I work with sql server 2008 on a database.

    we have export schema and datas with the command export datas

    click rigth on database => tasks => generate scripts => select all object => click advanced => select type of data to script => schema and data

    Now we have a file with all datas and schema

    That's perfect ...

    But how i can insert the file in a other database ?

    ok i can copy paste all datas in management studio and press f5 but when i do this the management studio fail because the size of the file is > 200 mega !!!!

    Is there another solution ?

    Thanks for your time and your knowledge

    Christophe

  • You can use SqlCmd utility from command line:

    sqlcmd -S yourservername -i sqlscript.sql

    Alex S
  • christophe.bernard 47659 (5/21/2015)


    Hi expert :),

    I work with sql server 2008 on a database.

    we have export schema and datas with the command export datas

    click rigth on database => tasks => generate scripts => select all object => click advanced => select type of data to script => schema and data

    Now we have a file with all datas and schema

    That's perfect ...

    But how i can insert the file in a other database ?

    ok i can copy paste all datas in management studio and press f5 but when i do this the management studio fail because the size of the file is > 200 mega !!!!

    Is there another solution ?

    Thanks for your time and your knowledge

    Christophe

    Why not just do a backup and restore?

    --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)

  • hi both,

    thanks for your time ans your solution ..

    sqlcmd work really fine thanks and very fast..

    Why we do not a back up restore ..

    i think that the back up restore take time prefer to my solution (export script => import script)

    but now the script is very big (200 mo) and management studio when i open this script inside does not respond .. 🙂

    well, thanks for your time guys

    have a nice day

    christophe

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

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