March 25, 2010 at 7:49 am
Paul White NZ (3/25/2010)
The Dixie Flatline (3/25/2010)
Tell me you have a life outside SQL.
(0 row(s) affected)
SOM 😛
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 25, 2010 at 9:47 am
Paul White NZ (3/24/2010)
STR has some interesting properties:- The numeric parameter is always converted to FLOAT(53) first
- The output is always (fixed length) CHAR - the default is CHAR(10)
- The default string output is left-padded with spaces if necessary
- It uses the ROUND algorithm (round up) if rounding is required
- The default CHAR(10) is not enough to hold all INTEGER values
...
The data type of the RESULT column in that example is VARCHAR(20) - from the ResponseComments column - since VARCHAR has a higher data type precedence than the CHAR(10) returned by STR.
Paul
Thank you for the detailed explanation! Point very well taken.
Now that we know the downsides of either of the two options the answer regarding the method to use is a lot easier: "It depends" 😀 :w00t:
March 25, 2010 at 10:04 am
lmu92 (3/25/2010)
Now that we know the downsides of either of the two options the answer regarding the method to use is a lot easier: "It depends" 😀 :w00t:
As always* 😉
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
March 25, 2010 at 10:24 am
It depends on whether or not it depends? :w00t:
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 25, 2010 at 10:40 am
The Dixie Flatline (3/25/2010)
It depends on whether or not it depends? :w00t:
Yes and/or no. :hehe:
March 25, 2010 at 11:11 am
The Dixie Flatline (3/25/2010)
It depends on whether or not it depends? :w00t:
I think we both know the (recursive) answer to that.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply