Skip to content

Creating New User to Access SQL Database

May 21, 2012

As I needed to create a new user for a new database for testing, with using the following template: –

CREATE LOGIN DatabaseUserWITH PASSWORD = ‘340$Uuxwp7Mcxo7Khy’; USE Database; GO CREATE USER DatabaseUser FOR LOGIN DatabaseUser;

I had stumbled upon a problem once the User can connect to the Database, ASP.NET subsequently threw an exception error as shown: –

The SELECT permission was denied on the object ‘user’, database ‘database’, schema ‘dbo’.

As I had later found out, it was the grant permission that the user ‘DatabaseUser’ couldn’t use the SELECT operation for the SQL database ‘Database’ because it simply doesn’t have the permission to do it, this can be simply corrected by going to Properties of the Database, and selecting Permissions, and for that user in Explicit tab, tick the SELECT row. 

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: