SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 The Yak Corral
 Twit List
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 88

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 10/16/2012 :  10:53:11  Show Profile  Reply with Quote
quote:
Originally posted by chadmat

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=179717





That’s just the right combination of arrogant and clueless.

Some people just prefer to learn things with no help from others.







CODO ERGO SUM
Go to Top of Page

JimL
SQL Slinging Yak Ranger

USA
1535 Posts

Posted - 10/19/2012 :  09:03:33  Show Profile  Visit JimL's Homepage  Reply with Quote
Don’t you just love having to explain higher concepts to an individual with the intelligence of a can of vanilla frosting.

Jim
Users <> Logic
Go to Top of Page

TG
Flowing Fount of Yak Knowledge

USA
6059 Posts

Posted - 11/21/2012 :  13:54:26  Show Profile  Reply with Quote
This isn't directed at anyone in particular but I am amazed at how many people seem to have absolutely no problem solving common sense.
For instance:
- syntax errors with dynamic sql and have never thought to print the command.
- multi statement process that fails "somewhere" and never thinks of a way to track what succeeded and what didn't.
- etc...

Has there always been developers can't think for themselves or is this a modern phenomenon caused by smart-phones and google?

Be One with the Optimizer
TG
Go to Top of Page

jimf
Flowing Fount of Yak Knowledge

USA
2869 Posts

Posted - 11/21/2012 :  14:11:37  Show Profile  Reply with Quote
It sure isn't caused by Google, or questions like this wouldn't be asked in forums
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=180844

I had the same question about LAG, googled it, and then got an answer all by myself. I think it's
just laziness. Why should I do any thinking when I can make you do it and then take the credit for it?

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 11/21/2012 :  17:30:56  Show Profile  Reply with Quote
quote:
Originally posted by TG

This isn't directed at anyone in particular but I am amazed at how many people seem to have absolutely no problem solving common sense.
For instance:
- syntax errors with dynamic sql and have never thought to print the command.
- multi statement process that fails "somewhere" and never thinks of a way to track what succeeded and what didn't.
- etc...

Has there always been developers can't think for themselves or is this a modern phenomenon caused by smart-phones and google?

Be One with the Optimizer
TG


People with the inability or lack of desire to track down problems existed way before smart-phones and google.

Taking it a bit further, I consider the ability to test, debug, and problem solve the true difference between a good developer and a bad one.

Looking at it a different way, good developers are pessimists who doubt their ability to produce perfect code, so they test it every possible way to make sure it does what it is supposed to do.

Bad developers are optimists who assume that their code will probably work, so they see no reason to waste time testing.

Optimistic developer = Bad developer

And the world is full of optimists.









CODO ERGO SUM
Go to Top of Page

theboyholty
Posting Yak Master

United Kingdom
221 Posts

Posted - 12/19/2012 :  04:18:31  Show Profile  Visit theboyholty's Homepage  Reply with Quote
I've always considered my logical approach to life in general to be my most valuable mental asset in trying to be a good developer. Working through a solution step by step, to make sure each part of the process works before moving onto the next one, is for me the most fundamental approach to the art and one I always try to make clear to those I'm training or mentoring.

You can teach someone SQL code until the cows come home, but as we all know, there's much more to it than knowing commands and syntax.

---------------------------------------------------------------------------------
http://www.mannyroadend.co.uk A Bury FC supporters website and forum
Go to Top of Page

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3383 Posts

Posted - 12/19/2012 :  05:07:07  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
>> Working through a solution step by step, to make sure each part of the process works before moving onto the next one

Nice in theory but inflexible and unlikely to succeed in anything but the simplest cases. Means if you are waiting for something for one step you sit around doing nothing rather than working on things further down the line. Also later steps might affect what needs to be done in earlier steps so often all need to be dealt with in parallel.
I would say you should teach people to concentrate on high risk areas first but always consider the whole system.

That's the problem with a lot of agile implementations. It often promotes silo development with people concentrating only on the task given, often to the detriment of the system as a whole.

I was at one recently where they knew an implementation wouldn't work and would bring down other systems but they said they couldn't take that into account - once it happened they could create a task and get a budget to fix the systems if the business wanted that. It was actually easier and quicker to implement a working system but that wouldn't fit in with their task split as it meant developing some infrastructure which would help in a number of areas and couldn't be linked to a single task.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.

Edited by - nigelrivett on 12/19/2012 05:12:11
Go to Top of Page

theboyholty
Posting Yak Master

United Kingdom
221 Posts

Posted - 12/19/2012 :  06:05:08  Show Profile  Visit theboyholty's Homepage  Reply with Quote
quote:
Originally posted by nigelrivett

>> Working through a solution step by step, to make sure each part of the process works before moving onto the next one

Nice in theory but inflexible and unlikely to succeed in anything but the simplest cases. Means if you are waiting for something for one step you sit around doing nothing rather than working on things further down the line. Also later steps might affect what needs to be done in earlier steps so often all need to be dealt with in parallel.
I would say you should teach people to concentrate on high risk areas first but always consider the whole system.



Well yes I was simplyfying things, as we were talking in a context where someone relatively inexperienced writes a solution which doesn't work then they panic, rather than either a) being able to split the task into its compenent parts, or b) having developed the thing in a logical manner in the first place, finding any errors as they arose rather than getting to the end and not knowing where it went wrong.

---------------------------------------------------------------------------------
http://www.mannyroadend.co.uk A Bury FC supporters website and forum
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 02/12/2013 :  18:37:55  Show Profile  Reply with Quote
I pointed out a minor flaw in the code ScottPletcher posted, and he has been madly defending it ever since. It was fun at first, but I reached my limit.

For a SQL Server MVP, he seems impervious to argument.

http://www.sqlservercentral.com/Forums/Topic1418065-391-1.aspx




CODO ERGO SUM

Edited by - Michael Valentine Jones on 02/12/2013 18:39:06
Go to Top of Page

russell
Pyro-ma-ni-yak

USA
5072 Posts

Posted - 02/13/2013 :  12:02:13  Show Profile  Visit russell's Homepage  Reply with Quote
Dates before 1900? Impossible! The world wasn't invented yet. I know this because it won't fit into a smalldatetime. I know when the world is going to end too...
Go to Top of Page

DonAtWork
Flowing Fount of Yak Knowledge

2161 Posts

Posted - 02/13/2013 :  14:56:10  Show Profile  Reply with Quote
wow. move the goalposts much?

Tool: Dates before 1900? IMPOSSIBLE!
signed, MS SQL MVP MCP MSCSZQX12 98 !!!!

Reasonable person: List all US presidents and dates in office.

Tool: FINE then anything before 1753 is silly too! SO THERE!
signed, MS SQL MVP MCP MSCSZQX12 98 !!!!









How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 02/13/2013 :  17:01:47  Show Profile  Reply with Quote
quote:
Originally posted by DonAtWork

wow. move the goalposts much?

Tool: Dates before 1900? IMPOSSIBLE!
signed, MS SQL MVP MCP MSCSZQX12 98 !!!!

Reasonable person: List all US presidents and dates in office.

Tool: FINE then anything before 1753 is silly too! SO THERE!
signed, MS SQL MVP MCP MSCSZQX12 98 !!!!


How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx



The funny thing is that I did work with a minor application that had times before 1900. It was an insurance administration application for life insurance for veterans of World War 1, so almost all of their birthdays were before 1900. I doubt that application is still alive.

For an application that could still be alive, I was thinking about something like a database to hold real estate records, with dates for property transfers, deeds, mortgages, and so on. Of course you might have to go back past 1753 in some places...


"Then 17530107 is pure foolishness too...
It's absolutely foolish to drastically over-design something to hold values it will NEVER need to hold..."


That's a bit overboard. Since there is no demonstrated drawback to using that date for a base, and it does produce correct results for the entire range of possible datetime values, I would just call it well designed.


"My business doesn't sell things in 1789 and never will."

Probably true, since that would require time travel into the past.


I am guessing there is a performance review somewhere with the words:
"Does not respond well to criticism."




CODO ERGO SUM

Edited by - Michael Valentine Jones on 02/13/2013 17:30:51
Go to Top of Page

robvolk
Most Valuable Yak

USA
15657 Posts

Posted - 02/13/2013 :  21:53:26  Show Profile  Visit robvolk's Homepage  Reply with Quote
Just out of curiosity, what about date and datetime2?

Wonder if he knows why 1753 was the original cutoff.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 02/13/2013 :  23:17:11  Show Profile  Reply with Quote
quote:
Originally posted by robvolk

Just out of curiosity, what about date and datetime2?

Wonder if he knows why 1753 was the original cutoff.


The same basic logic works with DATE and DATETIME2, but you have to explicitly cast everything, and the base year changes to 0001.

Of course the value of this for very old dates is debatable when you consider the change from the Julian to the Gregorian calendar, but I think if you are going to call it the last Sunday of the month, then it should actually be the last Sunday of the month.

But that's just my absolutely foolish tendency to drastically over-design talking.
I guess you can blame that on my fondness for code that always works.

select
	a.DT,
	LastDayofMonth =
	dateadd(mm,datediff(mm,convert(date,'00011231'),a.DT),convert(date,'00011231')),
	LastSundayofMonth = 
	dateadd(dd,(datediff(dd,convert(date,'00010107'),
	dateadd(mm,datediff(mm,convert(date,'00011231'),a.DT),convert(date,'00011231'))
	)/7)*7,convert(date,'00010107'))
from
	( -- Test data
	select DT = convert(date,'00010101') union all
	select DT = convert(date,'99991231') union all
	select DT = convert(date,getdate()) union all
	select DT = convert(date,dateadd(mm,-2,getdate())) union all
	select DT = convert(date,dateadd(mm,-1,getdate())) union all
	select DT = convert(date,dateadd(mm,1,getdate())) union all
	select DT = convert(date,dateadd(mm,2,getdate())) union all
	select DT = convert(date,dateadd(mm,3,getdate())) union all
	select DT = convert(date,dateadd(mm,4,getdate())) union all
	select DT = convert(date,dateadd(mm,5,getdate())) union all
	select DT = convert(date,dateadd(mm,6,getdate())) union all
	select DT = convert(date,dateadd(mm,7,getdate())) union all
	select DT = convert(date,dateadd(mm,8,getdate())) union all
	select DT = convert(date,dateadd(mm,9,getdate())) union all
	select DT = convert(date,dateadd(mm,10,getdate())) union all
	select DT = convert(date,dateadd(mm,11,getdate()))
	) a
order by
	a.DT


DT         LastDayofMonth LastSundayofMonth
---------- -------------- -----------------
0001-01-01 0001-01-31     0001-01-28
2012-12-13 2012-12-31     2012-12-30
2013-01-13 2013-01-31     2013-01-27
2013-02-13 2013-02-28     2013-02-24
2013-03-13 2013-03-31     2013-03-31
2013-04-13 2013-04-30     2013-04-28
2013-05-13 2013-05-31     2013-05-26
2013-06-13 2013-06-30     2013-06-30
2013-07-13 2013-07-31     2013-07-28
2013-08-13 2013-08-31     2013-08-25
2013-09-13 2013-09-30     2013-09-29
2013-10-13 2013-10-31     2013-10-27
2013-11-13 2013-11-30     2013-11-24
2013-12-13 2013-12-31     2013-12-29
2014-01-13 2014-01-31     2014-01-26
9999-12-31 9999-12-31     9999-12-26




select
	a.DT,
	LastDayofMonth = 
	dateadd(mm,datediff(mm,convert(datetime2,'00011231'),a.DT),convert(datetime2,'00011231')),
	LastSundayofMonth = 
	dateadd(dd,(datediff(dd,convert(datetime2,'00010107'),
	dateadd(mm,datediff(mm,convert(datetime2,'00011231'),a.DT),convert(datetime2,'00011231'))
	)/7)*7,convert(datetime2,'00010107'))
from
	( -- Test data
	select DT = convert(datetime2,'00010101') union all
	select DT = convert(datetime2,'99991231') union all
	select DT = convert(datetime2,getdate()) union all
	select DT = convert(datetime2,dateadd(mm,-2,getdate())) union all
	select DT = convert(datetime2,dateadd(mm,-1,getdate())) union all
	select DT = convert(datetime2,dateadd(mm,1,getdate())) union all
	select DT = convert(datetime2,dateadd(mm,2,getdate())) union all
	select DT = convert(datetime2,dateadd(mm,3,getdate())) union all
	select DT = convert(datetime2,dateadd(mm,4,getdate())) union all
	select DT = convert(datetime2,dateadd(mm,5,getdate())) union all
	select DT = convert(datetime2,dateadd(mm,6,getdate())) union all
	select DT = convert(datetime2,dateadd(mm,7,getdate())) union all
	select DT = convert(datetime2,dateadd(mm,8,getdate())) union all
	select DT = convert(datetime2,dateadd(mm,9,getdate())) union all
	select DT = convert(datetime2,dateadd(mm,10,getdate())) union all
	select DT = convert(datetime2,dateadd(mm,11,getdate()))
	) a
order by
	a.DT



DT                     LastDayofMonth         LastSundayofMonth
---------------------- ---------------------- ----------------------
0001-01-01 00:00:00.00 0001-01-31 00:00:00.00 0001-01-28 00:00:00.00
2012-12-13 23:15:29.31 2012-12-31 00:00:00.00 2012-12-30 00:00:00.00
2013-01-13 23:15:29.31 2013-01-31 00:00:00.00 2013-01-27 00:00:00.00
2013-02-13 23:15:29.31 2013-02-28 00:00:00.00 2013-02-24 00:00:00.00
2013-03-13 23:15:29.31 2013-03-31 00:00:00.00 2013-03-31 00:00:00.00
2013-04-13 23:15:29.31 2013-04-30 00:00:00.00 2013-04-28 00:00:00.00
2013-05-13 23:15:29.31 2013-05-31 00:00:00.00 2013-05-26 00:00:00.00
2013-06-13 23:15:29.31 2013-06-30 00:00:00.00 2013-06-30 00:00:00.00
2013-07-13 23:15:29.31 2013-07-31 00:00:00.00 2013-07-28 00:00:00.00
2013-08-13 23:15:29.31 2013-08-31 00:00:00.00 2013-08-25 00:00:00.00
2013-09-13 23:15:29.31 2013-09-30 00:00:00.00 2013-09-29 00:00:00.00
2013-10-13 23:15:29.31 2013-10-31 00:00:00.00 2013-10-27 00:00:00.00
2013-11-13 23:15:29.31 2013-11-30 00:00:00.00 2013-11-24 00:00:00.00
2013-12-13 23:15:29.31 2013-12-31 00:00:00.00 2013-12-29 00:00:00.00
2014-01-13 23:15:29.31 2014-01-31 00:00:00.00 2014-01-26 00:00:00.00
9999-12-31 00:00:00.00 9999-12-31 00:00:00.00 9999-12-26 00:00:00.00


CODO ERGO SUM

Edited by - Michael Valentine Jones on 02/13/2013 23:49:12
Go to Top of Page

DonAtWork
Flowing Fount of Yak Knowledge

2161 Posts

Posted - 02/14/2013 :  09:43:53  Show Profile  Reply with Quote
Yes, but if i convert your datetime to a varchar and ram in an invalid date, your code fails! You overdesign it and leave holes for abending !! I STILL WIN!!

signed, MS SQL MVP MCP MSCSZQX12 98 !!!!



Rob: 1753 does not matter because i have personally never used any date before 1900, therefore it is irrelevant and useless and i still win!

<\asshat>








How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Go to Top of Page

robvolk
Most Valuable Yak

USA
15657 Posts

Posted - 02/14/2013 :  10:28:04  Show Profile  Visit robvolk's Homepage  Reply with Quote
Oh yeah, well I'm a papal fanatic who's tracking popes that resign, and the last one resigned in 1415, so there!
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3565 Posts

Posted - 02/14/2013 :  10:38:35  Show Profile  Reply with Quote
Along the same lines: my wife is a fan of Jane Austen (1775-1817). I recently set up a database for her to track all kinds of information relating to the period, in her quest to write a "Pride and Prejudice" variation. For those who are not as devoted to Jane Austen as my wife is, "Pride and Prejudice" is Jane Austen's most famous work, and several variations of that book have been written by a number of authors. All the dates of course are in the late 18th and early 19th century.

And speaking of wives and special women in our lives, "Happy Valentine's day to all!!"
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 02/14/2013 :  14:04:43  Show Profile  Reply with Quote
quote:
Originally posted by James K

Along the same lines: my wife is a fan of Jane Austen (1775-1817). I recently set up a database for her to track all kinds of information relating to the period, in her quest to write a "Pride and Prejudice" variation. For those who are not as devoted to Jane Austen as my wife is, "Pride and Prejudice" is Jane Austen's most famous work, and several variations of that book have been written by a number of authors. All the dates of course are in the late 18th and early 19th century.

And speaking of wives and special women in our lives, "Happy Valentine's day to all!!"



She could update Pride and Prejudice into the modern age or near future as a cyberpunk novel and avoid all those dates before 1900 that no one should ever use.







CODO ERGO SUM
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3565 Posts

Posted - 02/14/2013 :  15:33:50  Show Profile  Reply with Quote
quote:
She could update Pride and Prejudice into the modern age or near future as a cyberpunk novel and avoid all those dates before 1900 that no one should ever use.
Not a chance!! My wife is so into 19th century fiction that, if she had a choice she would make me wear those waistcoats and breeches http://weblogs.variety.com/photos/uncategorized/2008/06/12/pride_firth5.jpg


Go to Top of Page

robvolk
Most Valuable Yak

USA
15657 Posts

Posted - 02/14/2013 :  15:40:40  Show Profile  Visit robvolk's Homepage  Reply with Quote
Well there's this: http://en.wikipedia.org/wiki/Pride_and_Prejudice_and_Zombies

But I think a better modern day setting would be:

Jane Austen's SEAL Team Six: Ultimate Pride and Extreme Prejudice: How America's Most Advanced Special Operations Unit Keeps Track of Their Dates in the 21st Century
Go to Top of Page
Page: of 88 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.3 seconds. Powered By: Snitz Forums 2000