Logical File Names

  • Comments posted to this topic are about the item Logical File Names

  • Hi Steve,

    seems to be NONE of the given examples are correct πŸ™‚

    USE [mydb]

    GO

    ALTER DATABASE [mydb]

    MODIFY FILE

    (

    NAME=N'OldName',

    NEWNAME=N'NewName_01'

    );

    GO

    I assume that you have forgotten to change the ADD FILE to MODIFIY FILE.

    Can you check your answers?

    Microsoft Certified Master: SQL Server 2008
    MVP - Data Platform (2013 - ...)
    my blog: http://www.sqlmaster.de (german only!)

  • Uwe Ricken (8/1/2015)


    Hi Steve,

    seems to be NONE of the given examples are correct πŸ™‚

    USE [mydb]

    GO

    ALTER DATABASE [mydb]

    MODIFY FILE

    (

    NAME=N'OldName',

    NEWNAME=N'NewName_01'

    );

    GO

    I assume that you have forgotten to change the ADD FILE to MODIFIY FILE.

    Can you check your answers?

    Hi Uwe ,

    You are right. But I think that it is only a little error.

    I have used this command 3 months for a SQL Server 2012 database and I have done some research about this topic in the SQL Server 2012 documentation which is easier to understand than the the SQL Server 2014 one.

  • Hi Patrick,

    maybe but this will lead to a wrong answer (as in my case). So - I'm not crazy about the points but the answers are ALL wrong from the Syntax!

    Query 1: no comment πŸ™‚

    Query 2: ADD FILE does not work with "NEWNAME"-Parameter

    Query 3: ALTER DATABASE does not have a Parameter called OLDNAME

    Query 4: no comment πŸ™‚

    Any of the answers may lead to a wrong decision.

    If you are concentrated to the MODIFY FILE only (which is nearest to the answer) you will fail (as I did).

    I've tuned out all ADD FILE commands.

    However - let's see what Steve will do.

    Have a wonderful Sunday and all the best to the sqlservercentral-community...

    Microsoft Certified Master: SQL Server 2008
    MVP - Data Platform (2013 - ...)
    my blog: http://www.sqlmaster.de (german only!)

  • It seems none of the queries are correct. Correct one is:

    ALTER DATABASE AdventureWorks2012

    MODIFY FILE (NAME=AdventureWorks2012_data, NEWNAME=AWD2012 );

    ____________________________________________________________

    AP
  • Not only do none of the answers appear to be correct but the the explanation does not match the options.

    The correct answer is Query 2, with the MODIFY FILE option and the Name and NewName options. This will change the logical file names of any of your files.

    Query 3 is the only query that has the MODIFY FILE option although the options are Oldname and Newname.

    I've got to say this is the most badly put together question I've seen for a long time. I know in many cases the wording, options and explanation are likely to provoke debate but rarely are they completely nonsensical.


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    β€”Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • BWFC (8/3/2015)


    Not only do none of the answers appear to be correct but the the explanation does not match the options.

    The correct answer is Query 2, with the MODIFY FILE option and the Name and NewName options. This will change the logical file names of any of your files.

    Query 3 is the only query that has the MODIFY FILE option although the options are Oldname and Newname.

    I've got to say this is the most badly put together question I've seen for a long time. I know in many cases the wording, options and explanation are likely to provoke debate but rarely are they completely nonsensical.

    +1

  • Carlo Romagnano (8/3/2015)


    BWFC (8/3/2015)


    Not only do none of the answers appear to be correct but the the explanation does not match the options.

    The correct answer is Query 2, with the MODIFY FILE option and the Name and NewName options. This will change the logical file names of any of your files.

    Query 3 is the only query that has the MODIFY FILE option although the options are Oldname and Newname.

    I've got to say this is the most badly put together question I've seen for a long time. I know in many cases the wording, options and explanation are likely to provoke debate but rarely are they completely nonsensical.

    +1

    +1. Abject failure.

  • Hardly an abject failure, he just got one word wrong.

    Though I was looking for a "none of the above" answer to "which of these queries will do this", because no queries were given, just 4 statements πŸ˜‰

  • Toreador (8/3/2015)


    Hardly an abject failure, he just got one word wrong.

    Though I was looking for a "none of the above" answer to "which of these queries will do this", because no queries were given, just 4 statements πŸ˜‰

    Seriously? You think this sort of imprecision is acceptable in a forum about programming?

  • -- Query 1

    ALTER DATABASE AdventureWorks2012

    ADD FILE (NAME=ADW2012 REPLACES Adventureworks2012_data)

    -- query 2

    ALTER DATABASE AdventureWorks2012

    ADD FILE (NAME=AdventureWorks2012_data, NEWNAME=AWD2012 );

    -- query 3

    ALTER DATABASE AdventureWorks2012

    MODIFY FILE (OLDNAME=AdventureWorks2012_data, Newname= AWD2012);

    -- query 4

    ALTER DATABASE AdventureWorks2012

    ADD FILE (NEWNAME=AWD2012, OLDNAME=AdventureWorks2012_data );

    here query3 is correct option which have Modify keyword.But today's question answer is showing Query2.

  • edwardwill (8/3/2015)


    Toreador (8/3/2015)


    Hardly an abject failure, he just got one word wrong.

    Though I was looking for a "none of the above" answer to "which of these queries will do this", because no queries were given, just 4 statements πŸ˜‰

    Seriously? You think this sort of imprecision is acceptable in a forum about programming?

    Ha ha, calm down Eddie πŸ˜€


    I'm on LinkedIn

  • edwardwill (8/3/2015)


    Toreador (8/3/2015)


    Hardly an abject failure, he just got one word wrong.

    Though I was looking for a "none of the above" answer to "which of these queries will do this", because no queries were given, just 4 statements πŸ˜‰

    Seriously? You think this sort of imprecision is acceptable in a forum about programming?

    I do. I've been a developer for over 30 years and understand fully that people can make mistakes whether it be in specification or coding.

    That's why we have testing. Look at today's question as an opportunity for some decent QA and it becomes much more worthwhile than a question about something few of are ever likely to do.

  • edwardwill (8/3/2015)


    Seriously? You think this sort of imprecision is acceptable in a forum about programming?

    Yes, I do, especially given that the forum is free. In this case, the mistake means that none of the options is correct, so nobody is going to leave the question with wrong information. Even if they didn't read this discussion, and managed to remember the 'correct' answer, then they'd realise something was wrong as soon as they tried it. But the important message is that there is a way of achieving this.

    Where things do start moving towards being "unacceptable" is where a question gives an incorrect but plausible answer, so anyone not following the discussion would "learn" something that was actually wrong. For instance if a question asserted that Truncate couldn't be rolled back (note this isn't a real example, but although there have been a few I can't remember any of them!)

  • Ah, the old "try to figure out the author's intent via mindreading" question--got to love them! I got the right answer simply by guessing correctly which typo had actually been made. e.g. had the author mistyped NAME as OLDNAME in query 3, or MODIFY as ADD in 2? The latter seemed more likely, and lo, it turned out to be the case.

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

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