Two SQL servers, 1 Database

Posted on 2012-09-21
Last Modified: 2012-11-08

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.
Question by:troosters
    LVL 5

    Expert Comment

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

    Author Comment

    Better work with some kind of textfile then ?
    LVL 5

    Expert Comment

    Can you discuss your requirement in a little bit of detail here? May be i can suggest an approach

    Author Comment

    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
    LVL 5

    Expert Comment

    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?
    LVL 14

    Expert Comment

    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.
    LVL 7

    Accepted Solution

    You can use SQL Server 2012 "Always On" to create an availability group

    You can use Windows Server 2008 R2/2012 Clustering which will be expensive but will work

    You can use a "SQL Fire" type solution for a quick load balancer solution, this works in VM Ware from what I've seen.

    Seems like you need a different solution for your appointment app.  This sounds like way too much in licensing and server overhead, but I could be wrong.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now