Sql-server – SQL server security

sql server

I have requirement that I need to take backup from production and need to restore it in development.

I have taken all users and permissions from production by generating scripts, but two users are facing an issue in the development copy because they do not have permission to CREATE,ALTER and EXECUTE. When I used the generate script feature to get their permissions from production, they are only db_reader and db_writer. But now they are getting errors like "execute permissions denied in stored procedure". Prior they were able to CREATE ,ALTER, and DROP stored procedures successfully.

How is this possible? My question is will the db_writer role allow a user to CREATE and DROP stored procedures?

Best Answer

My question is db_writer will create ,drop, alter the stored procedure

The answer is NO.

db_datawriter can only do INSERT, UPDATE, DELETE.

There could be a case when some user was the owner of that database, so it had the permissions of db_owner in this database, and after restore the owner was changed, but it cannot be your case as you have two users that now have not EXECUTE permission.