Sql-server – New login is created but ‘sa’ cant assign grant/deny permissions to user in SQL Server 2008 R2

sql serversql-server-2008-r2

I created users with login option in security tab in SQL Server 2008 R2 running on windows 7 successfully and grant permissions to :

Use dummydb
Grant REFERENCES  ON OBJECT::vuUser TO nvp
GO

Use dummydb
Deny INSERT,SELECT,UPDATE,DELETE ON OBJECT::dummyDB.userTb to nvp
GO

nvp user can login successfully and restriction work great but when I create user and grant permissions as above on SQL Server 2008 R2 running on windows server 2008.

User can login successfully but when I try to grant permission using above code, I get this message:

Msg 15151, Level 16, State 1, Line 2
Cannot find the object 'usertb', because it does not exist or you do not have permission.

Is their is something I am doing wrong or I need to try something else ?????

Database and table name are correct…

I login in using user 'sa' credentials

Need urgent help n thanks in advance

Best Answer

Syntax is OBJECT::Schema.Table not OBJECT::Database.Table

e.g.

use test
Deny INSERT,SELECT,UPDATE,DELETE ON OBJECT::dbo.T1 to public