Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

MS SQL7 - problem

  • 25-10-2000 09:25AM
    #1
    Closed Accounts Posts: 9


    Lets look in this simply SP:


    CREATE procedure test
    as
    Declare @cmd nvarchar(1000)

    SET @cmd=N'Select * from Users'

    exec sp_executesql @cmd


    User has rights only for executing SP in my DB. So my question is: why he can not execute this SP??? (error with permision on Users table). It is strange and now I have to add SELECT permision on USERS table for this user. This SP is running without problems:


    CREATE procedure test1
    as
    Select * from Users


    So why 'test' isn't running ???
    Users' table owner is dbo.


Comments

  • Closed Accounts Posts: 218 ✭✭Void


    From the SQL Server 7.0 help files on sp_executesql:

    Permissions
    Execute permissions default to the public role.

    Dunno if this is any help, but I think sp_executesql is a bit wierd. I reckon they did this deliberately because sp_executesql let's you run dynamically built sql statements, and is therefore a security risk.


Advertisement