Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

Dating for DBAs - a second date Expand / Collapse
Author
Message
Posted Tuesday, April 12, 2011 10:23 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, April 03, 2014 10:34 AM
Points: 3,352, Visits: 1,478
Comments posted to this topic are about the item Dating for DBAs - a second date
Post #1092547
Posted Tuesday, April 12, 2011 10:36 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 12:58 AM
Points: 1,904, Visits: 2,771
All 4 options work? one of those questions again...pick 2 out of 4 correct answers...a quessing game again.


----------------------------------------------
Msg 8134, Level 16, State 1, Line 1
Divide by zero error encountered.
Post #1092552
Posted Tuesday, April 12, 2011 10:42 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 7:17 AM
Points: 20,483, Visits: 14,137
All 4 options do work under some dateformat settings (but not all dateformat settings).

Only two options are correct as the question is stated.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1092554
Posted Tuesday, April 12, 2011 10:43 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 7:17 AM
Points: 20,483, Visits: 14,137
This is a good question - thanks Duncan



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1092555
Posted Tuesday, April 12, 2011 11:18 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, April 10, 2014 8:17 AM
Points: 86, Visits: 43
All 4 works correctly and I have selected only 2 as per the question.. So I am right and need my point back
Post #1092561
Posted Wednesday, April 13, 2011 12:07 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Sunday, April 20, 2014 11:47 PM
Points: 1,382, Visits: 1,775
Thank-you, Duncan for this wonderful series!

Thanks & Regards,
Nakul Vachhrajani.
http://beyondrelational.com/modules/2/blogs/77/nakuls-blog.aspx
Be courteous. Drive responsibly.

Follow me on
Twitter: @nakulv_sql
Google Plus: +Nakul
Post #1092573
Posted Wednesday, April 13, 2011 12:20 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 7:17 AM
Points: 20,483, Visits: 14,137
itsmatta (4/12/2011)
All 4 works correctly and I have selected only 2 as per the question.. So I am right and need my point back



Did you change your dateformat at all?




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1092581
Posted Wednesday, April 13, 2011 12:37 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Sunday, April 20, 2014 11:47 PM
Points: 1,382, Visits: 1,775
itsmatta (4/12/2011)
All 4 works correctly and I have selected only 2 as per the question.. So I am right and need my point back


No, all 4 do not work correctly everywhere (i.e. irrespective of date format and/or language settings). DATETIME and SMALLDATETIME are affected by the format.

Per Books On Line http://msdn.microsoft.com/en-us/library/ms189491.aspx,


The effect of the DATEFORMAT setting on the interpretation of character strings might be different for datetime and smalldatetime values than for date, datetime2 and datetimeoffset values, depending on the string format.


Thanks & Regards,
Nakul Vachhrajani.
http://beyondrelational.com/modules/2/blogs/77/nakuls-blog.aspx
Be courteous. Drive responsibly.

Follow me on
Twitter: @nakulv_sql
Google Plus: +Nakul
Post #1092586
Posted Wednesday, April 13, 2011 12:41 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, April 03, 2014 10:34 AM
Points: 3,352, Visits: 1,478
Henrico Bekker (4/12/2011)
All 4 options work? one of those questions again...pick 2 out of 4 correct answers...a quessing game again.


Try this:

SET DATEFORMAT ydm
GO
SELECT CAST('2011-04-28' AS DATETIME)

or this:

SET LANGUAGE British
GO
SELECT CAST('2011-04-28' AS DATETIME)

and do the same for the other date types, and you'll see that DATETIME and SMALLDATETIME produce an error while DATE and DATETIME2 don't.

So no guessing required!

Duncan
Post #1092587
Posted Wednesday, April 13, 2011 12:44 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, April 03, 2014 10:34 AM
Points: 3,352, Visits: 1,478
Nakul Vachhrajani (4/13/2011)
Thank-you, Duncan for this wonderful series!


You're welcome - although I'd hesitate to call 2 questions a series! Unless you're expecting more?
Post #1092589
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse