﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Steve Jones / Article Discussions / Article Discussions by Author  / Checking database access / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 05:56:56 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>3rd option almost tricked me</description><pubDate>Thu, 02 Aug 2012 08:25:01 GMT</pubDate><dc:creator>BudaCli</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Good question thanks</description><pubDate>Thu, 24 May 2012 06:02:57 GMT</pubDate><dc:creator>Robin Sasson</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Great question, thanks.</description><pubDate>Tue, 24 Jan 2012 02:41:41 GMT</pubDate><dc:creator>Koen Verbeeck</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Nice question Steve, thanks.</description><pubDate>Mon, 16 Jan 2012 05:22:18 GMT</pubDate><dc:creator>Britt Cluff</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Nice, tried to get a little tricky with that third option. Good question.</description><pubDate>Thu, 12 Jan 2012 10:23:01 GMT</pubDate><dc:creator>DBA_Dom</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Good question!!!Thanks Steve!!!!!</description><pubDate>Thu, 12 Jan 2012 05:32:21 GMT</pubDate><dc:creator>rfr.ferrari</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>good question I think. Reminds people of the function (or brings it to their attention for the first time) so its educational, but steve put a little twist in it so you had to think and not just google it.</description><pubDate>Wed, 11 Jan 2012 10:46:39 GMT</pubDate><dc:creator>george sibbald</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>ARRGH! should read the WHOLE question and choose two! :w00t:</description><pubDate>Wed, 11 Jan 2012 10:37:41 GMT</pubDate><dc:creator>BarbW</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>tks for the question</description><pubDate>Wed, 11 Jan 2012 09:14:23 GMT</pubDate><dc:creator>OzYbOi d(-_-)b</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Got this one wrong, but learned something...Thanks, Steve!</description><pubDate>Wed, 11 Jan 2012 08:52:47 GMT</pubDate><dc:creator>Revenant</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>[quote][b]SQL Kiwi (1/11/2012)[/b][hr]This function is one I don't use much.  I know what it does, but I hovered between single-user and suspect as the second option to the obvious first correct answer.  I have no experience of executing HAS_DBACCESS against a single-user mode database or a suspect one, so I took a guess.[/quote]That's exactly what was on my mind and exactly the same answers I marked.Best regards,</description><pubDate>Wed, 11 Jan 2012 08:18:32 GMT</pubDate><dc:creator>codebyo</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>[quote][b]SQL Kiwi (1/11/2012)[/b][hr][quote][b]L' Eomot Inversé (1/11/2012)[/b][hr]Nice and simple.[/quote]I see a lot of people saying this, but either my product knowledge is significantly below average or we're doing something differently.  I don't, for example, check BOL before answering - I do it on the spot.  That's not to say either way is right or wrong, just a potential point of difference.[quote]I'm very surprised there's only 34% correct so far, although I would expect the wiggle on whether  no other user is connected to a db which is in single-user mode would catch a few who didn't think hard (it returns 1 if an attempt to connect would have succeeded, which makes it pretty obvous that it can't return 1 if someone else is connected in single user mode, but while Vulcans might always get something like that right us poor humans sometimes don't think hard enough), but that doesn't seem to account for enough of the wrong answers.[/quote]This function is one I don't use much.  I know what it does, but I hovered between single-user and suspect as the second option to the obvious first correct answer.  I have no experience of executing HAS_DBACCESS against a single-user mode database or a suspect one, so I took a guess.edit: I should add that I am unsure of the value of this question, beyond one that simply asked a 'nice and simple' question about what HAS_DBACCESS does in normal circumstances.  I don't expect to remember the second correct option for any length or time, or that it would ever be important for me to do so.  Overall: meh.[/quote]I agree on the "not so obvious".  I also didn't use BOL but reasoned it like this -- you can't USE a DB when it is suspect and most of the time you have to USE a DB to run a function against it, so since you can't use a suspect DB you can't run this function against it.  Obviously based upon the answer you must be able to run it against any DB regardless of connection context.</description><pubDate>Wed, 11 Jan 2012 07:36:58 GMT</pubDate><dc:creator>jeff.mason</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>[quote][b]L' Eomot Inversé (1/11/2012)[/b][hr]Nice and simple.[/quote]I see a lot of people saying this, but either my product knowledge is significantly below average or we're doing something differently.  I don't, for example, check BOL before answering - I do it on the spot.  That's not to say either way is right or wrong, just a potential point of difference.[quote]I'm very surprised there's only 34% correct so far, although I would expect the wiggle on whether  no other user is connected to a db which is in single-user mode would catch a few who didn't think hard (it returns 1 if an attempt to connect would have succeeded, which makes it pretty obvous that it can't return 1 if someone else is connected in single user mode, but while Vulcans might always get something like that right us poor humans sometimes don't think hard enough), but that doesn't seem to account for enough of the wrong answers.[/quote]This function is one I don't use much.  I know what it does, but I hovered between single-user and suspect as the second option to the obvious first correct answer.  I have no experience of executing HAS_DBACCESS against a single-user mode database or a suspect one, so I took a guess.edit: I should add that I am unsure of the value of this question, beyond one that simply asked a 'nice and simple' question about what HAS_DBACCESS does in normal circumstances.  I don't expect to remember the second correct option for any length or time, or that it would ever be important for me to do so.  Overall: meh.</description><pubDate>Wed, 11 Jan 2012 06:55:52 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>[quote][b]L' Eomot Inversé (1/11/2012)[/b][hr]Nice and simple.I'm very surprised there's only 34% correct so far, although I would expect the wiggle on whether  no other user is connected to a db which is in single-user mode would catch a few who didn't think hard (it returns 1 if an attempt to connect would have succeeded, which makes it pretty obvous that it can't return 1 if someone else is connected in single user mode, but while Vulcans might always get something like that right us poor humans sometimes don't think hard enough), but that doesn't seem to account for enough of the wrong answers.[/quote]I got it wrong, because instead of BOL, I just used SSMS's SQL Help (2008 R2).  For that I have[quote]RemarksHAS_DBACCESS returns 1 if the user has access to the database, 0 if the user has no access to the database, and NULL if the database name is not valid.[/quote]</description><pubDate>Wed, 11 Jan 2012 06:53:44 GMT</pubDate><dc:creator>mtassin</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Still a suprisingly low correct[center][b]Correct answers: 35% (100) Incorrect answers: 65% (183) Total attempts: 283 [/b][/center]</description><pubDate>Wed, 11 Jan 2012 06:20:54 GMT</pubDate><dc:creator>bitbucket-25253</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Is it Monday? Thanks for an easy one.</description><pubDate>Wed, 11 Jan 2012 05:32:16 GMT</pubDate><dc:creator>Thomas Abraham</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Nice and simple.I'm very surprised there's only 34% correct so far, although I would expect the wiggle on whether  no other user is connected to a db which is in single-user mode would catch a few who didn't think hard (it returns 1 if an attempt to connect would have succeeded, which makes it pretty obvous that it can't return 1 if someone else is connected in single user mode, but while Vulcans might always get something like that right us poor humans sometimes don't think hard enough), but that doesn't seem to account for enough of the wrong answers.</description><pubDate>Wed, 11 Jan 2012 04:05:38 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Nice question Steve.Who's surprised that only 34% corrcet so far?</description><pubDate>Wed, 11 Jan 2012 03:10:53 GMT</pubDate><dc:creator>paul s-306273</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>I like qotd about new and/or particular feature.Thanks!:-D</description><pubDate>Wed, 11 Jan 2012 02:54:56 GMT</pubDate><dc:creator>Carlo Romagnano</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>AGGGH!I missed the obvious, checked BOL, selected my option (singular) submitted.Good question. ThanksIan</description><pubDate>Wed, 11 Jan 2012 01:27:18 GMT</pubDate><dc:creator>440692 I am just a number</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>That'll teach me to attempt these questions before my first cup of coffee in the morning.:hehe:good question, thanks.</description><pubDate>Wed, 11 Jan 2012 01:21:55 GMT</pubDate><dc:creator>Stewart "Arturius" Campbell</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Good question Steve.</description><pubDate>Wed, 11 Jan 2012 00:49:46 GMT</pubDate><dc:creator>mohammed moinudheen</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Nice - keep em coming.</description><pubDate>Tue, 10 Jan 2012 20:51:33 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Another nice easy question ......... Thanks</description><pubDate>Tue, 10 Jan 2012 20:50:40 GMT</pubDate><dc:creator>bitbucket-25253</dc:creator></item><item><title>Checking database access</title><link>http://www.sqlservercentral.com/Forums/Topic1233694-32-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/Security/87385/"&gt;Checking database access&lt;/A&gt;[/B]</description><pubDate>Tue, 10 Jan 2012 20:49:52 GMT</pubDate><dc:creator>Steve Jones - SSC Editor</dc:creator></item></channel></rss>