Link to home
Start Free TrialLog in
Avatar of troosters
troostersFlag for Belgium

asked on

Two SQL servers, 1 Database

Hello,

is it possible to have 2 SQL servers , but 1 DB file on a NAS location ?
I want to write a web application, but it needs to run on 2 pc's , but I want it to be possible that the pc's don't need to be powered on all the time.
Avatar of sameer_goyal
sameer_goyal
Flag of India image

No its not possible. Every DB on each server needs an exclusive access to the DB file.
Avatar of troosters

ASKER

Better work with some kind of textfile then ?
Can you discuss your requirement in a little bit of detail here? May be i can suggest an approach
Well it's for a client who has 2 pc's and he wants to add appointments in some kind of calendar application. Most of the time he does it on the pc in his office, but sometimes also on the pc in another room. Now he has some old program and for this both pc's need to be powered on plus the old program won't run on Windows 7.
So I need to add the appointments in some file that is located on an external disk . My knowledge of xml is nothing, so I thought to use a db on a nas, but as that does not work, maybe use a txt file ? or xml file
And you are creating a web application using ASP.NET?

I think Text files can work. Or you can use WCF services.

Have you worked with WCF before?

That way, you can actually create a service on the primary PC to provide the database access, you know. So you can from the other PC, through the service, access the DB and do what you want.

That way, there will be a centralized DB.

Alternatively, do you think you can connect these 2 PC in a network of some kind?
I am giong to write a dissenting opinion.  Yes, it is *possible* -- but only in very limited and controled circumstances.

For example, if one of the PC's will be a cold spare, configured exactly the same as the first -- never powered on when the first PC is running -- you could do it.  Or if you can guarantee that when computer 1 is being used computer 2 will be off, and vice-versa.

I am certainly not recommending that you do this -- and in fact strongly recommend against it.  But your question being "is it possible"...yes it is.  But you are more likely to end up with destroyed databases than happy results.



Better approach, if you really can't have a dedicated SQL server that is always on, would be to synchronize the two databases.  There are several database sync software packages that will handle this.
ASKER CERTIFIED SOLUTION
Avatar of MrAli
MrAli
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial