In Database We Trust

  • Comments posted to this topic are about the item In Database We Trust

  • Definitely an interesting question.

    It makes you think about the difference between a reserved keyword and just a keyword.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Nice question, thanks.

    Hope this helps...

    Ford Fairlane
    Rock and Roll Detective

  • Good question!

    Thanks!

    create database DEFAULT_DATABASE

    This runs!

    create database DELETE

    This DOESN'T run!

    You can use reserved words that stand for OPTIONS!

  • Interesting question!

    Only the SQL Server reserved keywords cannot be used directly as a database name, anything else can - http://technet.microsoft.com/en-us/library/ms189822.aspx

    You can use [] :-), anyway.

    Thanks

    Igor Micev,My blog: www.igormicev.com

  • This was removed by the editor as SPAM

  • Stewart "Arturius" Campbell (2/20/2014)


    SQLRNNR (2/19/2014)


    Definitely an interesting question.

    It makes you think about the difference between a reserved keyword and just a keyword.

    +1

    Yeah, it definitely made me think it through. Good question.

  • On multiple choice questions like this, it would be best if they did not say "(Select 2)", because four of the options will "use up" those two options: either the database is marked as trustworthy or it is not marked as trustworthy, and either the database will be set to read only or the database will not be set to read only. That means that the other two options must be false.

    Aside from that minor suggestion, I do like this question, because it makes you think about which keywords are reserved and which are not (even though it's not a good idea to use a keyword for a database name), and it's interesting that a setting that is changed by ALTER DATABASE is not actually stored in the database.

  • stephen.long 56048 (2/20/2014)


    On multiple choice questions like this, it would be best if they did not say "(Select 2)", because four of the options will "use up" those two options: either the database is marked as trustworthy or it is not marked as trustworthy, and either the database will be set to read only or the database will not be set to read only. That means that the other two options must be false.

    Aside from that minor suggestion, I do like this question, because it makes you think about which keywords are reserved and which are not (even though it's not a good idea to use a keyword for a database name), and it's interesting that a setting that is changed by ALTER DATABASE is not actually stored in the database.

    Oh man, that's true. I still learned something though.

  • Stephen, I'll consider that for my next question!

  • Whew... out of the beaten path, definitely. Thanks, Andy!

  • stephen.long 56048 (2/20/2014)


    On multiple choice questions like this, it would be best if they did not say "(Select 2)", because four of the options will "use up" those two options: either the database is marked as trustworthy or it is not marked as trustworthy, and either the database will be set to read only or the database will not be set to read only. That means that the other two options must be false.

    That makes it quite shocking that 55% (229 people) of those who answered it so far got it wrong, doesn't it? If someone can't reason logically are they safe to be let loose on someone's database :w00t: ? I suppose it could be agued that "pick 2" could mean "pick two of the correct answers" and two isn't necessarily all of them, but anyone who knows how questions are described to the system knows that the system couldn't cope with that (unless it's changed since I last submitted a question).

    Aside from that minor suggestion, I do like this question, because it makes you think about which keywords are reserved and which are not (even though it's not a good idea to use a keyword for a database name), and it's interesting that a setting that is changed by ALTER DATABASE is not actually stored in the database.

    Yes, it does seem interesting that Alter Database does that. I wonder what else (if anything else) that can be set by ALTER DATABASE is also stored elsewhere.

    Tom

  • Nice question, thanks.

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

  • Carlo Romagnano (2/20/2014)


    Good question!

    Thanks!

    create database DEFAULT_DATABASE

    This runs!

    create database DELETE

    This DOESN'T run!

    You can use reserved words that stand for OPTIONS!

    Yes but

    create database [DELETE]

    does work

    I am just waiting for someone to do this in real life. Oh the problems that could cause

    and then there is this http://stackoverflow.com/questions/332365/how-does-the-sql-injection-from-the-bobby-tables-xkcd-comic-work

  • happycat59 (2/20/2014)


    Carlo Romagnano (2/20/2014)


    Good question!

    Thanks!

    create database DEFAULT_DATABASE

    This runs!

    create database DELETE

    This DOESN'T run!

    You can use reserved words that stand for OPTIONS!

    Yes but

    create database [DELETE]

    does work

    I am just waiting for someone to do this in real life. Oh the problems that could cause

    and then there is this http://stackoverflow.com/questions/332365/how-does-the-sql-injection-from-the-bobby-tables-xkcd-comic-work%5B/quote%5D

    Well, I am dealing with a vendor that has a table named [NULL], numerous columns named [NULL], and I was completely surprised they didn't just name the database [NULL].

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 15 posts - 1 through 15 (of 20 total)

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