SELECT permission denied on object 'tblAreaPincode', database 'prithivnediyo', owner 'dbo'.

Posted by Vanchi050585 under Sql Server on 10/18/2010 | Points: 10 | Views : 4318 | Status : [Member] | Replies : 5
Dear All,

When the url is browsing the following error will occured from the database server. But, Other databases are working very fine except this server.

Errror :

SELECT permission denied on object 'tblAreaPincode', database 'prithivnediyo', owner 'dbo'.

Pls send the solutions.

Thanks
tvn

Thanks
tvn



Responses

Posted by: PandianS on: 10/18/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi,

- You don't have permission to use SELECT statement on this Database "prithivnediyo" for the Login you have used.
- You have to grant the SELECT Permission to the User what you have used to login...

Try to identify the 'SELECT' permission availability on 'prithivnediyo' database for the user
USE prithivnediyo 

GO

IF EXISTS(SELECT 1 FROM fn_my_permissions(NULL,'DATABASE')
WHERE permission_name='SELECT')
SELECT 'The User ''' + SUSER_SNAME() + ''' have ''SELECT'' permission on ''' + DB_NAME() + ''' database' 'Permission'
ELSE
SELECT 'The User ''' + SUSER_SNAME() + ''' doesn''t have ''SELECT'' permission on ''' + DB_NAME() + ''' database' 'Permission'
Solution:
1. Login into "Sysadmin" role login (sa) or some thing else.. if any
2. Use the following Statement...
Use prithivnediyo

Go
GRANT SELECT TO <Your UserName>
Now, login into the User as you used earliar and try the SELECT statement on this database (prithivnediyo)

Cheers

Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vanchi050585 on: 10/19/2010 [Member] Starter | Points: 25

Up
0
Down
hi friend,

In the following query shall i change any object name or database name, because when i am executing this the following error occured.

Msg 208, Level 16, State 1, Line 4
Invalid object name 'fn_my_permissions'.

Another doubts how to Login into "Sysadmin" . Because i know only the single username and password.

Pls tell briefly..

USE prithivnediyo

GO



IF EXISTS(SELECT 1 FROM fn_my_permissions(NULL,'DATABASE')

WHERE permission_name='SELECT')

SELECT 'The User ''' + SUSER_SNAME() + ''' have ''SELECT'' permission on ''' + DB_NAME() + ''' database' 'Permission'

ELSE

SELECT 'The User ''' + SUSER_SNAME() + ''' doesn''t have ''SELECT'' permission on ''' + DB_NAME() + ''' database' 'Permission'

Thanks
tvn

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: PandianS on: 10/19/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi

1. What is your SQL Server Edition and Version you using ?

2. If the Function(fn_my_permissions) is not supporting on your Edition / version of SQL Server then, Pls try the follwoing alternate one...
SELECT has_perms_by_name('prithivnediyo', 'Database', 'SELECT') 'Permission'

If the script returns 1 then , You have SELECT Permission on your Database for the login
If the script returns 0 then , You don't have SELECT Permission on your Database for the login

3. If you don't know the Sysadmin role login (sa), Pls ask your DBA to provide the required permission...

Cheers

Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vanchi050585 on: 10/19/2010 [Member] Starter | Points: 25

Up
0
Down
HI FRIEND,

My edition is Ms sqlserver 2005, and Management Studio Express.

And i am working on small concern. we dont have any systemAdmin.

SELECT has_perms_by_name('prithivnediyo', 'Database', 'SELECT') 'Permission'

The Above query returned the below error:

Msg 195, Level 15, State 10, Line 1
'has_perms_by_name' is not a recognized function name.




Thanks
tvn

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lalji_mer on: 10/19/2010 [Member] Bronze | Points: 25

Login to post response