July 2, 2010 at 6:58 am
Paul,
I agree that explicit is clearer than implicit. I will reread your post and the reference a couple of times and will hopefully retain some of it.
In practice, I will use Cast when I can. I will probably invoke the 1.0 trick when my statements become long and complex.
Again, thanks to both of you for your efforts in explaining what is going on.
pat
July 2, 2010 at 7:08 am
Eugene Elutin (7/2/2010)
Thanks Paul, I haven't read the article you posted about precision, scale and length rules. It makes sence now. Usually, I would explicitly convert the first required value(s) in the calculation formula and let the end result be converted implicitly as per destination or formatted as required if it is for output (report or other).
Sure, that works fine too.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
July 2, 2010 at 7:10 am
mpdillon (7/2/2010)
Again, thanks to both of you for your efforts in explaining what is going on.
No worries - that's what we do.
Oh, and in case you were wondering, very very few professional DBAs know the precision and scale formulas - or even that they exist, so don't sweat it too much.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
July 2, 2010 at 7:19 am
Paul White NZ (7/2/2010)
...Oh, and in case you were wondering, very very few professional DBAs know the precision and scale formulas - or even that they exist, so don't sweat it too much
...
I guess it is more than enough to know these formulas exist and now I do know they are. So, when required they could be googled out. I wouldn't try to keep them in my head, as well said by sir A.C.D via S.H. :
"I consider that a man's brain originally is like a little empty attic, and you have to stock it with such furniture as you choose. A fool takes in all the lumber of every sort that he comes across, so that the knowledge which might be useful to him gets crowded out, or at best is jumbled up with a lot of other things, so that he has a difficulty in laying his hands upon it."
July 2, 2010 at 7:37 am
Eugene Elutin (7/2/2010)
I guess it is more than enough to know these formulas exist...
I remember very few facts since facts do not age well.
I have mad Googling skillz though :laugh:
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply