Linked Questions

4
votes
5answers
175 views

Handling optional parameters in stored procedure

I have a stored procedure, say "Test" with an optional parameter @Param1 int = NULL. In the procedure, the value of @Param1 is used to update the value of some column in some table, if the ...
2
votes
1answer
341 views

Stored Procedure Execute as Owner Close Database Connections Not Working

I created a stored procedure to allow users to Close All Db connections in the QA environment. I am SA and created the procedure. When I modify the SP , run it Without 'Execute as Owner', I get ...
3
votes
2answers
6k views

Last time of trigger execution

SQL SERVER 2014 - Is there a way to know last time of trigger execution ?
1
vote
2answers
988 views

how to grant permissions to all the synonyms inside a view?

I have to grant permissions to a view. dbo.my_view, however, this view joins many tables, and other views and synonyms. using the following script I can find all all the synonyms in my server: ...
4
votes
4answers
3k views

What minimum permissions and/or roles must a SQL Server login possess to be able to grant database db_datareader role to other logins?

To delegate the ability for a security admin to add new SQL logins to the db_datareader role within a database, what are the least permissions and/or roles the security admin must possess?
3
votes
2answers
2k views

DDL trigger permission Error

I have a two users, user1 and user2. User1 has sysadmin rights and I have created a database level trigger through sa. Now I am trying to create a table through user2 who has db-ddladmin rights and ...
4
votes
3answers
4k views

Execute xp_cmdshell as a non-windows user

So I have a bunch of database users who should be able to execute a procedure with a call to xp_cmdshell. They are not windows domain accounts, they are just sql-server logins. I want to do it using a ...
4
votes
2answers
908 views

Assigning permissions for sysmail_update_account_sp

I have a Microsoft SQL Server 2014. The mail system is configured via DBMail and there is one stored proc in main web app (having its own database) which executes msdb's sysmail_update_account_sp by ...
1
vote
0answers
53 views

Grant permission to update dbmail

We want to grant a user the ability to update their own mail connection profile used by db mail in msdb. For example, when the IT company maintaining the mail server wants to change the password. We ...
3
votes
1answer
2k views

stored procedure can select and update tables in other databases - minimal permissions granted

I recently had to make the stored procedure spPartyOrderAllocation_AllocateItems to select and update tables in other databases, while keeping the pemissions levels to the minimum. This was ...
1
vote
2answers
2k views

Role to view SQL server job log

We have a monitoring tool that can check if Microsoft SQL Server jobs have run successfully. What I want to do is create a user that has as little permission as possible but it must be able to watch ...