March 29, 2017 at 2:36 pm
thisisfutile - Wednesday, March 29, 2017 2:26 PMI sure hope this isn't considered bad etiquette by reviving a 5 year old thread but the reply button was available so...I'm like Crissy, I'm stuck in Tsql so I'll need to formate a date using functions. Does anyone have an opinion concerning speed/performance on Paul White's excellent idea of 'FORMAT' (I'm on 2012 and wasn't aware of this function) versus Jeff's suggestions of STUFF or SUBSTRING?
Thank you!
It's usually better to create a new thread and reference the old thread.
To answer your question. FORMAT is horribly expensive. DO NOT use FORMAT.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
March 29, 2017 at 5:00 pm
thisisfutile - Wednesday, March 29, 2017 2:26 PMI sure hope this isn't considered bad etiquette by reviving a 5 year old thread but the reply button was available so...I'm like Crissy, I'm stuck in Tsql so I'll need to formate a date using functions. Does anyone have an opinion concerning speed/performance on Paul White's excellent idea of 'FORMAT' (I'm on 2012 and wasn't aware of this function) versus Jeff's suggestions of STUFF or SUBSTRING?
Thank you!
FORMAT is 44 times slower than CONVERT. I've not tested the alternate solution that I've posted on this thread but I do know that REPLACE and STUFF are nasty fast and probably won't add much time to it all. If I get some time, I'll test it on a million row table and see what happens.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 30, 2017 at 3:10 pm
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy