5

I want to connect my db on SQL Server 2008 over local area network I want to put it on one computer on the LAN so any computer on the network can access it what should I do please give me correct steps

2 Answers 2

7

In a Client-Server scenario, you will have the SQL Server installed on your server machine.

Clients will be the computers accessing that SQL Server using a client software (can be SQL Server Management Studio, web/forms application, Excel worksheet, etc).

Each of the client will provide you a way of making a connection to the SQL Server Instance running on the server. From server you will need IP Address or Servername along with SQL Server Instance name. They both combined form host name.

Data Source = ServerName\InstanceName
Note: Instance name not required for default instance.

User name: You need to add user from domain or a sql server authenticated user under security tab (SSMS) on the SQL Server.

Password: Corresponding password.

Note: Once you add a user to SQL Server Instance, do not forget to attach the user to databases you want the user to access and provide appropriate role(s).

Sign up to request clarification or add additional context in comments.

3 Comments

in client is he need connection string or what ? and in server how to add users ?
If you have access to the server on which SQL Server is installed (seems like you will have it most likely) see if SQL Server Management Studio is installed. Open SSMS and take a look at 'Connect to Server' dialog box for a minute and you will understand much clearly all pieces involved in making a connection to SQL Server from local machine or a client machine
Take a look at the step-by-step msdn.microsoft.com/en-us/library/ms345318.aspx
4
  1. Install SQL Server 2008 on one machine on your LAN (let's call it SQLServer)
  2. Connect that machine to the LAN (network cable)
  3. You're done.

Now, all other computers can connect to that SQL Server machine by its name in the connection string - in .NET, that would look like:

server=SQLServer;database=YourDatabase;User ID=YourUser;Pwd=top$Secret 

2 Comments

yourdatabase do you meen for example learning or learning.mdf ? or the full path
@salamonti: the name of the database (not the file!) - in SQL Server, you have a database which has a name - that's the name you need. Clients don't need to (and never should) know the details of the files behind a database - it could be different over time, too

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.