Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Deny db_name(), @@Version and related Expand / Collapse
Posted Thursday, July 17, 2014 12:28 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, June 1, 2015 5:42 AM
Points: 9, Visits: 81

Please, how do I deny SELECT on DB_NAME(), @@VERSION, SYSTEM_USER(), @@SERVERNAME, IS_SRVROLEMEMBER and more to an SQL login?

Post #1593775
Posted Saturday, July 19, 2014 6:11 AM



Group: General Forum Members
Last Login: Wednesday, February 10, 2016 11:50 AM
Points: 6,897, Visits: 13,559
All I can think of is to deny SELECT in general and only allow EXECUTE.
However, I don't know if this will also work for system variables.

A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
Post #1594307
Posted Saturday, July 19, 2014 7:01 AM



Group: General Forum Members
Last Login: Monday, November 21, 2016 11:03 AM
Points: 20,009, Visits: 18,255
Deny select doesn't work for the system functions. And you can't deny execute on the functions such as @@servername because it will invoke an error.

I don't see any documentation on what the minimum permissions are to be able to execute those functions.

You might try to harden the server with regards to the public role. But that is risky and I have seen more than a few clients who have messed up their server by doing it wrong.

Jason AKA CirqueDeSQLeil
I have given a name to my pain...


Posting Performance Based Questions - Gail Shaw
Post #1594311
Posted Saturday, July 19, 2014 7:17 AM



Group: General Forum Members
Last Login: 2 days ago @ 5:18 AM
Points: 45,619, Visits: 44,147
May I ask why? What is the root problem you're trying to solve here?

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1594314
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse