SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


ALTER


ALTER

Author
Message
Daniel Bowlin
Daniel Bowlin
SSCrazy Eights
SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)

Group: General Forum Members
Points: 8064 Visits: 2629
I had a tough time with this one. I have to do some more reading. Thanks for the question and teh explanation.
UMG Developer
UMG Developer
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4080 Visits: 2204
Interesting question, but it seems like it was more of a trick question than anything... The questions says "management wants to change the loginname so that it can accept longer loginnames up to 60 characters and that is the only change requested."

Given that Option 1 is the only option, Option 2 violates what management requested by making the field NULLable as well. So I chose the correct answer not actually thinking about the performance difference, as I didn't see that it was relevant.

Though I did learn a little more about the NULL bitmap, so that is a good thing. :-)
bitbucket-25253
bitbucket-25253
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15947 Visits: 25280
As stated by others:
Good post. Always good to learn something new in the QOD


Thanks for a thought provoking / learning experience keep up the good work.

Sankar Reddy - Looking forward to additional QOD from you

If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
andrew@tregonning.net
andrew@tregonning.net
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1255 Visits: 146
Given that option 2 changes the column to allow nulls, and that was not desired, I believe "Option 2 will fail" is the best answer.

-at
Sankar Reddy
Sankar Reddy
SSC Eights!
SSC Eights! (858 reputation)SSC Eights! (858 reputation)SSC Eights! (858 reputation)SSC Eights! (858 reputation)SSC Eights! (858 reputation)SSC Eights! (858 reputation)SSC Eights! (858 reputation)SSC Eights! (858 reputation)

Group: General Forum Members
Points: 858 Visits: 1250
Going thru the comments, it seems NOT everyone is aware that NOT NULL clause is necessary when altering the column. It’s a simple fact but not everyone knows about that. I am still surprised over ¾ of the people got this incorrectly. I hope at-least few people will know more about NULL bitmap because of this QoD.

Hugo mentioned that I might get some grief over the answer options. I tried to come up with a different set of answer options that are intelligent yet simple and relevant but didn’t make it this time.

I tried to bring a fresh look for the QoD, like a code review instead of just asking a random question. Look at this question as a code review project and not just a random out of the box question.

I have few ideas for the next QoD’s and will try to make them better from the feedback I received here. Thanks for participating in this and sharing the feedback (both good & bad). Appreciate it.




Sankar Reddy | http://SankarReddy.com/
ziangij
ziangij
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3608 Visits: 377
thanks , really nice question...:-)
back_of_the_fleet
back_of_the_fleet
SSC Veteran
SSC Veteran (279 reputation)SSC Veteran (279 reputation)SSC Veteran (279 reputation)SSC Veteran (279 reputation)SSC Veteran (279 reputation)SSC Veteran (279 reputation)SSC Veteran (279 reputation)SSC Veteran (279 reputation)

Group: General Forum Members
Points: 279 Visits: 485
I too learned something new today about something I didn't even know existed (NULL bitmap).

Excellent question.

JR


John Rogerson
BI Technical Lead
Clear Channel International
john.arnott
john.arnott
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3634 Visits: 3059
Sankar Reddy (7/14/2010)
Going thru the comments, it seems NOT everyone is aware that NOT NULL clause is necessary when altering the column. It’s a simple fact but not everyone knows about that. I am still surprised over ¾ of the people got this incorrectly. I hope at-least few people will know more about NULL bitmap because of this QoD........

Count me as one who hadn't realized that an ALTER column statement defaults to making it nullable. While the behind-the-scenes, performance related explanation is appreciated, the primary lesson is to include NOT NULL in the ALTER statement unless you really want to change the column to nullable.

One more thought: Isn't it a shame that when we're doing real-world changes we don't get neatly wrapped multiple-choice questions?
UMG Developer
UMG Developer
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4080 Visits: 2204
john.arnott (7/15/2010)
[quote]Sankar Reddy (7/14/2010)
One more thought: Isn't it a shame that when we're doing real-world changes we don't get neatly wrapped multiple-choice questions?


Yep, that is one of the things I have said to people when they comment on my high scores on the MCTS and MCITP tests.

When my boss comes to me and says they need something to be setup he doesn't give me five choices with one of them being correct. That would be nice, but not realistic.
Sankar Reddy
Sankar Reddy
SSC Eights!
SSC Eights! (858 reputation)SSC Eights! (858 reputation)SSC Eights! (858 reputation)SSC Eights! (858 reputation)SSC Eights! (858 reputation)SSC Eights! (858 reputation)SSC Eights! (858 reputation)SSC Eights! (858 reputation)

Group: General Forum Members
Points: 858 Visits: 1250
I am glad this QoD has helped people learn new things. The credit should directly go to Hugo Kornelis for his excellent feedback otherwise this would have been an incorrect/ordinary question.

Sankar Reddy | http://SankarReddy.com/
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search