Grant execute permission for a user on all stored procedures in database?

前端 未结 5 890
傲寒
傲寒 2020-12-07 14:40

I generated script from old database, created a new database and imported all data from old database. So far so good, however, no user has execute rights for stored procedur

5条回答
  •  萌比男神i
    2020-12-07 14:58

    Create a role add this role to users, and then you can grant execute to all the routines in one shot to this role.

    CREATE ROLE 
    GRANT EXECUTE TO 
    

    EDIT
    This works in SQL Server 2005, I'm not sure about backward compatibility of this feature, I'm sure anything later than 2005 should be fine.

提交回复
热议问题