[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Open Query

Posted on 2004-11-23
4
Medium Priority
?
261 Views
Last Modified: 2012-06-27
I have looked at a lot of diffent ideas, but does anyone know how to lock down an open query in SQL. An example of this would be, lets say I have a linked server  that has open query. How could I make it so, that only certain users could access said query.

Thanks!!
0
Comment
Question by:Jojo1771
4 Comments
 
LVL 16

Assisted Solution

by:muzzy2003
muzzy2003 earned 450 total points
ID: 12656828
Can't you just do that by appropriately mapping your local user IDs to remote ones when you set up the linked server?
0
 
LVL 6

Assisted Solution

by:Duane Lawrence
Duane Lawrence earned 450 total points
ID: 12656973
Hit the F1 key and bring up books online, that is where I found this.

deny all
on stored_proc_name
to userid_name

grant exec
on stored_proc_name
to userid_name



See Also

Granting Permissions
DENY
REVOKE
sp_addgroup
sp_addlogin
sp_adduser
sp_changegroup
sp_changedbowner
sp_dropgroup
sp_dropuser
sp_helpgroup
sp_helprotect
sp_helpuser
0
 
LVL 34

Accepted Solution

by:
arbert earned 600 total points
ID: 12667809
Agree with Muzzy2003, take a look at using a linked server.  Not only can you map logins, but you don't have to hardcode a user/password as you do with openquery (of course, if you're using openquery to obtain a true passthru query, then a  linked server may not be an option)....Granting and revoking permissions would be an option if you encapsulate your openquery in a proc..
0
 
LVL 5

Author Comment

by:Jojo1771
ID: 12707334
Not what I was looking for, but your input is appreciated.
0

Featured Post

Technology Partners: 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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

872 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