January 9, 2023 at 12:00 am
Comments posted to this topic are about the item The Time Conversion
January 9, 2023 at 7:21 am
Too funny. I wish it returned an error instead. One that says, "Dude! Just because this is 2022, you shouldn't expect anything different here!" 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
January 9, 2023 at 2:21 pm
Too funny. I wish it returned an error instead. One that says, "Dude! Just because this is 2022, you shouldn't expect anything different here!" 😀
Then use straight CAST. The only reason to use TRY_CAST here is if you don't want an error returned.
(Also, it's 2023 ; P )
January 9, 2023 at 2:23 pm
This is a very good reminder that data validation is not just limited to the straight format.
January 9, 2023 at 3:57 pm
TRY_CAST can be useful for simplifying error handling as it returns NULL rather than raising an error.
😎
Nice one Steve, maybe some people will read the documentation 😉
January 9, 2023 at 4:29 pm
This is a very good reminder that data validation is not just limited to the straight format.
Yep... I totally get that but this is one of those places where I think it should still provide something other than NULL. I know... that's just me.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 9, 2023 at 4:49 pm
TRY_CAST can be useful for simplifying error handling as it returns NULL rather than raising an error. 😎
Agreed but I've also found that it makes people complacent about figuring out when went wrong with the process that provides the data and beating on the providers to fix it. If it ground stuff to a screeching halt, they'd find some way to get someone to fix the data instead of kicking the proverbial can down the road forever.
Don't get me wrong... I love the feature because I can load the other 20 million rows but I always do the follow up to have someone clean up their junk process. A lot of people don't because they're not even aware that a NULL can be either a NULL in the data or a NULL that TRY_CAST() created because of an actual error. Even reading the actual documentation won't prevent people from doing stupid things with it.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply