Database to sql script?

  • I have created a website that uses a sql server database.

    I am new to this and am having trouble transferring the database to my host’s server.

    I have used a sql script to create the tables and views on the host’s server using Enterprise Manager by:

    Right clicking the database – all tasks – create sql script.

     

    My problem is this, I have created the tables but can’t work out how to transfer the contents of the tables to the host’s server.

    Is it possible to create a sql script to do this?

    What is the preferred method of transferring all the table records to the destination server?

     

    Chris

  • There are 3 ways as far as i can think.

    1. You can use dts to transfer the data from one server to another if they are on the same network.

    2. You can create a link server on the destination server & use select into command.

    3. Export the data to .cvs file from EM & then import the data from data import wizard in destination server.

     

     

     

     

    ------------
    Prakash Sawant

    http://psawant.blogspot.com

  • Alternatively,

    backup the database, copy the backup file to the destination server and restore.

  • aonther alternative: Narayana Vyas Kondreddi wrote a stored proc that you pass the table name and it creates all the INSERT INTO TABLENAME statements: note you cannot use this to insert image/text data fields, and if the INSERT statement created was longer than 8000 chars it would cut off, but it is a very useful sp to add to your toolbox

    http://vyaskn.tripod.com/code.htm#inserts

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Use EM to export data to the new server.  Choose the option to export database objects & select the tables you want to export.

    Works for me in a similar scenario.

    Mike

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

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