Solved

Give right  to user in   SQL Server 2005.

Posted on 2009-06-27
4
382 Views
Last Modified: 2012-05-07
Hi experts !

Im using SQL Server 2005 SP3. Im log with limit user via SQL Server autentaction. But now, I want to execute this :

Select P.spid, p.Hostname, P.Program_Name, P.Loginame, C.client_net_address, c.client_tcp_port
          From master.dbo.sysprocesses P Left Join sys.dm_exec_connections C on P.spid = c.session_id

And probably will want to be able to do kill spid. Other question: how is exatly synatcis of kill spis ?

The main question is: is there way to give right only to these master.dbo.sysprocesses, sys.dm_exec_connections and kill spid ? I do not want to give more right that is nesseasry to this user & with give him role . I need SQL script that do this.



0
Comment
Question by:dvplayltd
  • 2
  • 2
4 Comments
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 24728477
You can ask either your DB Administrator or if you have another login with full privileges, then you can grant read permission on that table to the user which you require.

grant select on master.dbo.sysprocesses to ur_user;

ur_user needs to be replaced with your user login and the above statement needs to be executed with a user who has privileges on that table. ( This should help and I am not able to test since I dont have access to machine)

Syntax to kill spid:

kill spid

replace spid with the spid you need to kill.

Hope this helps
0
 

Author Comment

by:dvplayltd
ID: 24730564
To rrjegan17

Thank you, I will give you point. Only 1 question - for rights of Kill
I found this:
Permissions
Requires membership in the sysadmin and processadmin fixed database roles.

Is there way to grant permission only for kill to my user, not all permission for this role ?
0
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 500 total points
ID: 24730648
To Kill a SPID, the user Requires the ALTER ANY CONNECTION permission. ALTER ANY CONNECTION is included with membership in the sysadmin or processadmin fixed server roles.

>> Is there way to grant permission only for kill to my user, not all permission for this role ?

Not possible. If you have ALTER ANY CONNECTION permission, it wont be specific for a single user as it applies to all.
0
 

Author Closing Comment

by:dvplayltd
ID: 31597566
OK .. I will add user like mamber of processadmin . Thank you.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question