0

I have an application, written probably in C# or VB.NET and accessing a SQL Server Express database.

It has .MDF and .LDF files in the same directory as executable.

How to make this application to run from network share in general case?

UPDATE

EXPRESS version of SQL server is not 100% server-based solution. Projects for express version can regard running SQL server just as a driver to access data. I.e. in all access function calls they can refer MDF filename, while server itself works just as transparent helper.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Dims
  • 47,675
  • 117
  • 331
  • 600
  • 2
    Please **don't** start to mess around with network shares and stuff like that. SQL Server is a **server-based** solution - if you want to give multiple users access to your data - put the database on a **server machine** and access it from there! – marc_s Apr 04 '14 at 15:19
  • Suppose your version. So, application has hardcoded path to local server and to database inside it. How can we substitute this information, so that another instance of an application could access remotely running server? Has it some shortcuts? – Dims Apr 04 '14 at 15:41
  • It is pointing to the IP of the server or a DNS Name? – Matt The Ninja Apr 04 '14 at 17:09
  • @MattTheNinja nobody knows, not me was writing the program; I need to try atl least SOME possibilities – Dims Apr 04 '14 at 19:06
  • @MattTheNinja most probably it uses "local" approach, which I said – Dims Apr 04 '14 at 19:06

1 Answers1

0

Theoretically you CAN however...

  1. Your application can communicate with SQL Server over network (this is normal and designed for this)

  2. SQL Server engine needs best possible read/write access to its .MDF / .LDF files for the best performance. Access over a file share it isn't optimized for. Therefore I would recommended it. You would be better reinstalling SQL on the location where you want the SQL Server database files kept. As its express its only a few GBs I would just clear up space and keep them locally.

  3. If possible put SQL Server on SSD or other fast disk, or put on its on drive not shared with OS etc this will also help with performance.

But to answer your question it would 'work' over a share, not good practice however.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Matt The Ninja
  • 2,641
  • 4
  • 28
  • 58