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


T-SQL Query


T-SQL Query

Author
Message
StarNamer
StarNamer
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1638 Visits: 1992
Robert (4/15/2008)
Right, but Steve once mentioned that QoD is not about best practices. Some are about bad practice, probably to spark discussions like this, which is OK for me.

If the solution was "correct" in all respects or even mentioned that what was proposed is a bad practice, there would be no discussion.
That's true.

The danger is, however, that some people may get the newsletter, read the articles and editorials, answer the QOTD, and never look at the followup discussion as to whether the 'right' answer is actually a good answer.

I think I've mentioned before that I find the most interesting questions are often the ones with wrong or ambiguous answers, because then I often learn something new.

Derek
Robert-378556
Robert-378556
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1762 Visits: 1010
Derek Dongray (4/15/2008)

The danger is, however, that some people may get the newsletter, read the articles and editorials, answer the QOTD, and never look at the followup discussion as to whether the 'right' answer is actually a good answer.

I think I've mentioned before that I find the most interesting questions are often the ones with wrong or ambiguous answers, because then I often learn something new.

That's life. There are always dangers. If one is so gullible to take it as good practice and not suspect a bit to at least take a look at discussion, he/she should change profession.
Such tricks are good to test trainees or employee candidates.
Mark Harr
Mark Harr
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1584 Visits: 191
kevriley (4/15/2008)
There is always 101 ways to do anything in t-sql - the trick (or more specifically, the skill) is knowing which is the right wayBigGrin

That's one of the attributes that separate a DBA from a developer!


Correct. The developer will usually get the better way done, while a DBA will usually just say it can't be done.



Mark
Rob Goddard
Rob Goddard
Right there with Babe
Right there with Babe (716 reputation)Right there with Babe (716 reputation)Right there with Babe (716 reputation)Right there with Babe (716 reputation)Right there with Babe (716 reputation)Right there with Babe (716 reputation)Right there with Babe (716 reputation)Right there with Babe (716 reputation)

Group: General Forum Members
Points: 716 Visits: 558
Correct. The developer will usually get the better way done, while a DBA will usually just say it can't be done.


Ouch, although I think that is almost true in a lot of circumstances:

Just the other day a developer's 'solution' entailed enabling xp_cmdshell, switching authentication to mixed mode and creating a sql user in the sysadmin role just to programmatically copy log files from a SQL machine. I said that can't be done! Hehe

--------
I love deadlines. I like the whooshing sound they make as they fly by. -Douglas Adams
Robert-378556
Robert-378556
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1762 Visits: 1010
Based on one case?
It doesn't matter dba or developer. The person matters and there are a lot of different kinds in both baskets. Also, there are many people that are both.
Megistal
Megistal
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1894 Visits: 2555
Same as chandrasekhar.ms

The first thing that came in my mind was using truth table permutation
OR by NOT(AND) and thus satisfying the request.
Christian Buettner-167247
Christian Buettner-167247
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3547 Visits: 3889
And just to mention that we all have made bad decisions in our past.
Some might not admit it, but thats how we function. We're not robots.

Best Regards,

Chris Büttner
GSquared
GSquared
SSC-Insane
SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)

Group: General Forum Members
Points: 23317 Visits: 9730
Rob Goddard (4/15/2008)
Correct. The developer will usually get the better way done, while a DBA will usually just say it can't be done.


Ouch, although I think that is almost true in a lot of circumstances:

Just the other day a developer's 'solution' entailed enabling xp_cmdshell, switching authentication to mixed mode and creating a sql user in the sysadmin role just to programmatically copy log files from a SQL machine. I said that can't be done! Hehe


LOL

(My solution would be SSIS, if I had to use something SQLy for it.)

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
John Portnov
John Portnov
SSC Rookie
SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)

Group: General Forum Members
Points: 25 Visits: 67
How does it satisfy a requirement if Feb can have an even or odd number of days, depending if it is a leap year? This solution is obviously not correct.
StarNamer
StarNamer
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1638 Visits: 1992
John Portnov (4/15/2008)
How does it satisfy a requirement if Feb can have an even or odd number of days, depending if it is a leap year? This solution is obviously not correct.
The solution is counting the number of letters in the name of the month, not the days in the month!

The solution itself is correct, just not very sensible. Smile

Derek
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