File Groups

  • SA-1

    SSCrazy Eights

    Points: 8113

    Comments posted to this topic are about the item File Groups

  • ChiragNS

    One Orange Chip

    Points: 26137

    knew the answer but clicked on the wrong button 🙁

    "Keep Trying"

  • Chris Houghton

    SSCrazy

    Points: 2497

    ChiragNS (10/19/2009)


    knew the answer but clicked on the wrong button 🙁

    I didn't, although I should have.:Whistling: Overlooked the fact that the constraint was clustered. Good question 😛

  • Robert Frasca

    SSCertifiable

    Points: 6026

    So it just ignores the FG2 reference? The fact that it essentially corrects the developer's mistake is great, I guess, but shouldn't the engine inform the developer that it's doing so?

    "Beliefs" get in the way of learning.

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 720511

    nice question, I missed the clustered part.

    The engine definitely should inform someone if this doesn't work.

  • SanjayAttray

    SSChampion

    Points: 13157

    Very good question. I was asked this question in an interview.

    Q). What's the easiest and fastest way to move data of a table from file1 to file2?

    A). Move the clustered index from file1 to file2.

    SQL DBA.

  • GabyYYZ

    SSCertifiable

    Points: 7913

    SanjayAttray (10/19/2009)


    Very good question. I was asked this question in an interview.

    Q). What's the easiest and fastest way to move data of a table from file1 to file2?

    A). Move the clustered index from file1 to file2.

    Why would that be faster than say, creating a target table on file2 and inserting all into it from the source table?

    Gaby
    ________________________________________________________________
    "In theory, theory and practice are the same. In practice, they are not."
    - Albert Einstein

  • KevinC.

    SSCommitted

    Points: 1570

    Great question. I learned something new.:-D

  • AlexSQLForums

    SSChampion

    Points: 14254

    Give us more i love these kind of questions.

    Alex S
  • john.arnott

    SSChampion

    Points: 11882

    Steve Jones - Editor (10/19/2009)


    nice question, I missed the clustered part.

    The engine definitely should inform someone if this doesn't work.

    Funny thing. I missed this because I DID see the clustered part and figured that SQL would complain about it. Oh, well; learned something here for sure.

  • Toby White

    SSCertifiable

    Points: 6127

    I knew the data would be with the clustered index, but I wasn't sure whether the inner reference or outer reference would win, or whether an error would be thrown. I spent 10 minutes setting up a test environment to make sure. I would have been guessing among my three options otherwise.

  • BudaCli

    Hall of Fame

    Points: 3383

    GabyYYZ (10/19/2009)


    SanjayAttray (10/19/2009)


    Very good question. I was asked this question in an interview.

    Q). What's the easiest and fastest way to move data of a table from file1 to file2?

    A). Move the clustered index from file1 to file2.

    Why would that be faster than say, creating a target table on file2 and inserting all into it from the source table?

    I suppose part of the question was easiest and fastest...

    Otherwise nice questions after all.

    What you don't know won't hurt you but what you know will make you plan to know better
  • Pam Brisjar

    SSChampion

    Points: 12094

    I knew this one because I've been "bit" by it before. Would indeed be better if there was a warning.

    And for the why not create another table and move the data into that, there's DDL issues and possibly space issues, too. It's also many more steps.

  • TomThomson

    SSC Guru

    Points: 104773

    Ouch -you got me - I didn't notice "clustered".

    And I've complained about people not reading questions carefully:blush:!

    Tom

  • rchantler

    SSCrazy

    Points: 2125

    Got this one wrong. I figured since there was a contradiction in the statement, SQL should complain. Why does it choose FG1 over FG2? Seems arbitrary to me.

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

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