In this tutorial, we will be showing you how to import your MSSQL database to your onCloud database server using the Microsoft Server Management Studio tool, which can be downloaded from the link below:
1) Open Microsoft SQL Server Management Studio and connect to the database server with using the database server name, login and password that you created for your database. This information can be found on the https://manage.myhosting.com control panel, under the More Services -> Databases link and by clicking on your database name in the list, next to the label 'External Hostname'.
2) After you connect to the database server, find your database name in the object explorer pane.
3) After selecting your database from the list click the "New Query" button from the top of the page to import your data.
4) Open up your .sql file in a text editor like Notepad++ and copy and paste it into the Query Window. Make sure that there are no "Create" or "Use" statements with the old database name included in the Query Window.
If any of these commands are present please remove them or put /***** in front of the command and *****/ right after it to comment it out.
After you make the changes click "Execute" to import the data to your database.
5) Make sure the execution of the import was completed successfully.
6) If you receive an error message for "Out of Memory Exception" that means the database is too big to be imported which means you need to try another method to import to the server.
Alternative Method (command line)
1) Open a Command Prompt window as an Administrator to import your database on the same computer that you have installed Microsoft SQL Server Management Studio on.
2) Use this command as indicated below to import your database to your MS SQL database server.
Sqlcmd –S <SQL DATABASE SERVER NAME> -U <SQL DATABASE USERNAME> -P <SQL DATABASE PASSWORD> -d <SQL DATABASE NAME> -i <SQL DATABASE LOCATION ON THE LOCAL MACHINE> -o <Report file location on the local machine (Optional)>
3) Wait until the command has completed. This process will take some time depending on your database file size.
4) View your log file and check for any errors that may have occurred during the import process.
At the conclusion of this tutorial, you should now have successfully imported your MSSQL database to your onCloud database server.