Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Give right  to user in   SQL Server 2005.

Posted on 2009-06-27
4
Medium Priority
?
386 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

705 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