Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 create login,user

Author  Topic 

Arun.G
Yak Posting Veteran

81 Posts

Posted - 2010-07-21 : 02:10:01
i want to create one login for testing team

username,password for the login
and that login should access only test database only

i want the query for that

i used:


USE [test_qa_build_v1]
GO
CREATE LOGIN [testanalyst] WITH PASSWORD=N'test1@3', DEFAULT_DATABASE=[test_qa_build_v1], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO


and after login , i tried to access the test db, its throwing the following error:




TITLE: Microsoft SQL Server Management Studio
------------------------------

Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

The SELECT permission was denied on the object 'extended_properties', database 'mssqlsystemresource', schema 'sys'. (Microsoft SQL Server, Error: 229)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.1600&EvtSrc=MSSQLServer&EvtID=229&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------


wat to do?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-07-21 : 02:20:19
Assigning the default database to a login does not mean the login will have access to that database.

You will still need to create the user for that database. user CREATE USER to do that


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -