Two Admin accounts for SQL Server

637 Views Asked by At

I have windows xp on two systems.On one machine i have installed sql server 2005 express. now from the other machine which is on LAN with the first machine, i will access sql server to insert data via a .net application. my server instance is A-9. i have created alias as : A-9-1. my connection string is :

conn.ConnectionString= "Data Source=A-9-1 ; Trusted_Connection =true "; -- this is using windows authentication.my windows user name is Admin, without any password.

now, when i connect to sql server on machine 1, from the client machine, then error occurs saying: Login failed for A-9\Guest.

Can i not connect to sql as Administrator from the client machine also, i.e. using windows authentication. means, there would be two administrators for sql server. one is A-9\Admin on the server machine, and the other would be A-9-1\Admin on the client machine. is this possible?

actually i want to give all privileges to the client machine user, for the sql database, he could create logins,users, databases, tables, insert data, give permissions and do everything.

also,

1

There are 1 best solutions below

44
On BEST ANSWER

1) You can setup as many logins as you want that have any number of permissions in SQL Server. This includes owner rights on a database.

2) If you want to give access to ANY client machine, then add A-9\Guest as a login under Security for the database. Then give them the appropriate rights.

Be aware that this will give anyone who connects to the server machine the rights that you specify for A-9\Guest.

3) There would not be a second admin called A-9-1\Admin. Since it sounds like you are not using Active Directory on a Domain in your network, the server has no way to know what the user/login is of the client machine. This is why you see the error: Login failed for A-9\Guest. Also it sounds like A-9-1 is the name of the connection, but not the machine/domain.

In your scenario, you would be better off just using SQL Authentication and setting a username and password for the client machine to use for access.

EDIT

Some Active Directory Links:

WARNING: While setting up AD is not 'hard', it is a involving process that takes planning. *

AD Quick Start Set Up Guide

Google Search for setting up active directory

I still think you would be better off using SQL Authentication. :)