May 11, 2009 at 5:20 pm
Good afternoon, i need your help
Im new a Sqlserver specially in Security issues,
I always connect to a SQLSERVER databasex directly from the server with the Network domain account called Datamart1\produccion, but locally (from my PC) logging as an Network domain account called NH\Odatamart cannot login and the message appears:
Login failed for user NH\odatamart
Clearly the above message says this NT account has no permissions to connect to a database.
How can i give permissions to this windows account (NH\odatamart) to connect to databasex and is there any sql command ?
Because im designing a script specially using ADO Objects to access to databasex and query a select statement, is there any command in sql server to have access to the database with that user account and has permissions to exexute select statements? and after having the resulsets or desired data can i reverse the access?
Id appreciate your help
May 12, 2009 at 8:18 am
Create this Login in SQL Server and give the Permission you need on the correct Database just like you give permission to a normal SQL User.
-Roy
May 12, 2009 at 5:07 pm
yes, you`re right but I'd like to know if I could create a login using T-SQL or a store procedure , then granting permission on select statements and finally reverse the loging in order to not to have access.?
Can i use sp_grantlogin? and which are the parametres
Id appreciate your help
May 13, 2009 at 12:11 am
You have to Create Login. Only after that can you do a Grant.
http://msdn.microsoft.com/en-us/library/ms189751(SQL.90).aspx
Or Books Online will give you the complete syntax for Create login.
-Roy
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply