Question

I am starting to develop database for my application. But before I embark upon a long journey I would like to have few questions answered. I am a starter in SQL Server, so please bear with my ignorance.

Basically I have several SQL Server instances running on my local machine. I am trying to architect databases containing several table schemas and their relationships using SQL Server Developer Studio.

  1. If I host my application on a remote shared server is it possible to create SQL Server Instance on that remote machine and have my developed database and its tables exported to run on this remote server instance?

  2. Is this facility available in the SQL Server Developer Express? The free version I am using.

I would really like to get these questions clarified before I move any further. I don't want to do all the hard work just to find out that exporting databases is not the easiest thing to do. I would really appreciate your responses.

Était-ce utile?

La solution

This is how I have done this in the past when I developed on a local instance and then moved it to a client's server:

  1. Create an instance of SQL server on the remote machine. It helps if it is the same build (I found that out the hard way!)
  2. Copy the MDF/LDF files from your local instance to the remote instance
  3. Using the Management Studio on the remote machine, look for the databases in the Object Explorer
  4. You should be able to right click on the folder, choose attach, then Add, and select your MDF file, then click OK

This should bring up your instance on the remote machine.

Autres conseils

You could just back it up from your dev machine and restore it on your production machine. You can find information on use of the TSQL backup command here: http://msdn.microsoft.com/en-us/ms186865.aspx

The database file format is compatible between the versions, so you can just detach and attach the file as an option. See here: What version of SQL Server do I need to move database to production server?

Note: Regardless of the option you use, you won't automatically get server logins, maintenance schedules and the like, but you will get the database definitions (and data), which is what you were asking about.

I had to do this on a remote server which I did not have direct access except for a command window.

From my local database, I generated all table scripts.

To export data, I created a client program that read records from my tables and generate SQL INSERT statesments.

This worked for me even with different database engines.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top