Last post Mar 13, 2015 05:18 AM by Krunal Parekh
Mar 12, 2015 05:30 PM|mdehghani|LINK
hi everyone.. I used to have a sqlCE .sdf local file which I converted(migrated) it to a local sql server instance using webmatrix.. now I want to transfer this local database's tables including schema and data to a hosted sql server database(2012).. I
have even managed to connect to the hosted server using sql management studio 2014.. can somebody describe a step by step procedure to carry out the rest? I have read a few tutorials but got more confused because some of previous methods are outdated by now.
thank you in advance.
Mar 13, 2015 03:29 AM|Mikesdotnetting|LINK
What kind of hosting do you have?
Mar 13, 2015 04:21 AM|Krunal Parekh|LINK
If your database is not too large the easiest way is to just Generate database schema and data script using
Generate Scripts Wizard and run it on the server.
It will create an exact copy of the local database schema and data.
Have a look at this article on how to achieve this.
I think this is the easiest way for you since you already have access to the server.
Hope this helps.
Mar 13, 2015 04:22 AM|mdehghani|LINK
@MIKE: a windows server 2012 shared hosting plan with "websitepanel" that allows me to build sql databases (apparently not complete instances).. thats all i know..
Mar 13, 2015 04:26 AM|Mikesdotnetting|LINK
Then Krunal Parek's suggestion is probably a good one.
Mar 13, 2015 04:45 AM|mdehghani|LINK
yes but i think the problem is that I don't have full control over the sql server instance so i suppose I can't run the generated script on the sql server to create the database for me.. it appears that my host only creates a database with a prefix in the
sql server (for example 216_azmoon) and I can only control the database not the sql server.. can i still achieve my goal with the given method? I think I'm looking for a script to create tables in an existing database not a script that creates a database and
Mar 13, 2015 04:59 AM|Krunal Parekh|LINK
In the Wizard you can chose if you want to generate the whole database or just specific tables or views.
1. Create a Database on the server manually.
2. Generate scripts to create tables and then run those scripts on the server database. That way should work.
Mar 13, 2015 05:07 AM|mdehghani|LINK
thanks.. and how should i "run those scripts on the server database" ? i don't think this part has been covered in the tutorials
Mar 13, 2015 05:18 AM|Krunal Parekh|LINK
I have even managed to connect to the hosted server using sql management studio 2014..
Since you are already opened the server in Studio.
you can do it like this
Use [Your Database Name]
--- Your Table Scripts
Press F5 in Studio to Run the script