Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Granting select on a table in a stored procedure

Status
Not open for further replies.

rzirpolo

Programmer
Apr 8, 2002
163
GB
I need to incorporate a grant statement in my stored procedure because it is using dynamic SQL.

The syntax I am entering is,

grant select on tablename to "Admin Role"

When running this on it's own it works fine. But when attempting to put in my stored procedure I get the error message,

Server: Msg 170, Level 15, State 1, Procedure sp_rpt_data, Line 17
Line 17: Incorrect syntax near 'Admin Role'.

What am I doing wrong ?

 
Try
grant select on tablename to [Admin Role]


======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top