Home ยป How To Guides | Useful tips

How to copy data from Godaddy SQL server database to your local DB table?

  9. Oct 2010 by Soan

I just got a question from one of our reader about the difficulty in copying the database table data from Godaddy server to local (Home PC) database table. Yes, it is not straight forward and you need to tweak some things to copy it.

The user also contacted GoDaddy support for help but could not get a satisfactory response.

I just looked into it and found this simple hack that can be used to copy data to your local database table. Although, this is not the best method but it works for your modest needs of copying data as there is no other reliable method is available.

Here are the steps:
  1. Log in to your Database server on Godaddy. Look on the left panel and your would find a 'Generate INSERT script' link. click this link.

    SQL server web admin Godaddy
  2. A new window opens up in right hand side panel. Select the Database name, Table name. You can also choose the columns for which you want to copy data. I have selected all as an example. Click on 'Create Script' button.

    Create Insert script Godaddy
  3. A new insert script is generated by system in the lower panel. You should COPY all the insert statements (example shown in yellow).

    You may have hundreds of INSERT statements in your scripts depending upon the number of rows in your database table. I have just one here as my table only contains 1 (one) row. The system generates 1 INSERT statement for 1 row of data.

    Note that you need to copy ONLY the insert statements and leave out the other statements like 'GO' and other statements.

    Select INSERT statements
  4. Open your Visual studio or SQL server management studio. Open your local Database and its table where you would like to copy the data. If you are in Visual studio, open the database explorer and open tables. Right click the table name and click 'Show table data'.
  5. Go to the SQL view of the table. Now paste copied INSERT statements. Remove the [Database Name].[Dbo]. portion from all INSERT statements. This is because your local database instance may not have the same name as your database on godaddy SQL server.
    If they have the same name, you need not remove this.

    Remove INSET database names
  6. Click on execute button (the red exclamation symbol in toolbar) if your visual studio window or run the SQL if you are in SQL server management studio.

    There might be an error dialog that comes up to say that the INSERT statements are not correct in Visual studio. There is no need to worry, just click 'OK'. Even though it reported an error, the INSERT statements will be executed.
  7. Just reopen the table and you will find all the data correctly inserted in your local database table.
Although the method only allows you to copy data one by one on table basis, it is fast and reliable as compared to other option available through Godaddy.

I hope it helps all. If you know of any other hack to achieve the goal, please share it with us in comments.

Would you like to share this article?

QR Code for this page Scan this QR code to open this
article in any mobile browser
or share with friends.


For more helpful articles like this, subscribe to our free newsletter or stay connected on social networks:

SUBSCRIBE
Subscribe to AM22 tech in Reader or by Email
Sign up for our updates in Email (Free):

 

Have questions? Write into comments or ask in forum