I No Longer Have Access to My DB and I'm a DBCreator!

  • Interesting question - but the title does seem to contain the answer.

    To run that on my system I would have to switch security to allow SQL users as well as windows users, and then switch it back again when finished. But first I would have to either log in on the PC as a privileged user or run SQLCMD as a privileged user, instead of being my normal non-privileged user. Too much hassle, and against my self-imposed rules for a non-emergency situation, so I didn't make any attempt to run it despite the question actually telling us to run it - the second one which did that recently. The SQLCMD script language isn't hard to understand, so it seemed easy to see what would happen even without the title.

    Hugo's experience seems odd - I can't see any way that the user has access to the database after the change of owner. Since I don't have sql users onmy system, I can't test to see if I get the same result.

    Tom

  • Hi Hugo

    The only reason I can think of is that your "model" database has the "guest" user enabled with read permissions so your login is getting access to the new database as guest, rather than as itself??

    Cheers

    Roddy

  • L' Eomot Inversé (1/23/2014)


    Interesting question - but the title does seem to contain the answer.

    To run that on my system I would have to switch security to allow SQL users as well as windows users, and then switch it back again when finished. But first I would have to either log in on the PC as a privileged user or run SQLCMD as a privileged user, instead of being my normal non-privileged user. Too much hassle, and against my self-imposed rules for a non-emergency situation, so I didn't make any attempt to run it despite the question actually telling us to run it - the second one which did that recently. The SQLCMD script language isn't hard to understand, so it seemed easy to see what would happen even without the title.

    Hugo's experience seems odd - I can't see any way that the user has access to the database after the change of owner. Since I don't have sql users on my system, I can't test to see if I get the same result.

    SQL Server security is getting quite complex, doesn't it? And is may vary with the fixes that you did or did not install. Well, that's what keeps us in ranks of reasonably well paid professionals.

  • Nice question, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • .....and this is why I am NOT a DBA by trade....

    0 points for me.

  • Toreador (1/23/2014)


    Interesting question, but the title meant it was easy to get the right answer.

    Though it looks like almost half the people who answered didn't read the title 😉

    +1 True, the title made it easy to answer; yet I found it a good & interesting question.

    Thanx.

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • interesting question..

    Thanks Andy for great QOTD.

  • It was a very good question. The first two were simple but the third one was tricky. 🙂

Viewing 8 posts - 16 through 22 (of 22 total)

You must be logged in to reply to this topic. Login to reply