I need to run my application on network. The application is based on SQL Server DB.
I have created my databases and stored them in the data directory of my application. Setup shall copy them to the application folder. Upto here it is fine. Please guide me about the following:
1) I guide my user to attach the databases to SQLExpress instance of the server and give all access from SSMS. Am I right?
2) Then user installs application on on client computer. I can set it so that application prompts for server name where to connect to access the data.
How to get this name? How can I know how the user has setup the SQL Server Express and what instances has been made?
3) If I use .\SQLExpress as server name and instance, will it work? What if there are more than one servers installed. Where will my .\ take my connection to?
4) What if there is already an instance in the Client’s computer. Will my .\SQLExpress portion still go to server or try to find the database on local computer?
Off course database is not attached on local computer and there will be an error.
I am really confused. Please help.
Thanks a lot.
Yes, but the user should have rights to do that and have to know how to do that.
You should try to connect to DB or leave it on user’s responsibility – to provide a valid sql server instance address
Instead of dot (.) use real name of computer or its IP address, and you’ll never be confused:
COMPUTERNAME\SqlExpress
If you properly set up the connection string – the app will never interfere with other instances of Sql Server anywhere