We help IT Professionals succeed at work.

syntax question on granting permissions

Medium Priority
242 Views
Last Modified: 2012-06-27
Using SQL Server 2000.  I get the error  Incorrect syntax near 'OBJECT:'.

when I try:
USE COFSE; GRANT INSERT ON OBJECT:: tblUserInfo TO 218009094; GO
Comment
Watch Question

Commented:
try

USE COFSE
GRANT INSERT ON  tblUserInfo TO 218009094
GO

Author

Commented:
Now I get :
Incorrect syntax near '218009094'.

Commented:
i'm assuming that's your user id, correct?

Commented:
try just

USE COFSE
GRANT INSERT ON  tblUserInfo TO 218009094

Author

Commented:
yes it is.  I got the syntax from MSN so I don't understand why its not working.

Author

Commented:
I still get the same error.
Senior DBA
CERTIFIED EXPERT
Most Valuable Expert 2018
Distinguished Expert 2019
Commented:
GRANT INSERT ON tblUserInfo TO [218009094]
Scott PletcherSenior DBA
CERTIFIED EXPERT
Most Valuable Expert 2018
Distinguished Expert 2019

Commented:
Standard object names cannot start with a digit; since that one does, you must delimit it or it "confuses" SQL's parser.

Author

Commented:
U DA MAN!!!  I can't tell you how much this helps.
Scott PletcherSenior DBA
CERTIFIED EXPERT
Most Valuable Expert 2018
Distinguished Expert 2019

Commented:
Np; glad it helped :-) .

Explore More ContentExplore courses, solutions, and other research materials related to this topic.