L' Eomot Inversé (10/18/2012)
But the explanation is very poor, inaccurate. For example the length of the expression "123.45" is 6, but str(123.45,4,2) is not '**' as suggested by the explanation but '123'.
It is an exact copy from the http://msdn.microsoft.com/en-us/library/ms189527(v=sql.100).aspx, first example!
The examples on that page contain no explanations, so how can the explanation be an exact copy of something in one of them? Also, the length and decimal parameters are not the ones in the first example, but the ones in the second.
I guess the real point is that the length of '123.45' is irrelevant to whether '**' turns up, all that is relevant is the length of '123', since str is perfectly happy, if neccessary to get a result other than '**', to thow away everything after the decimal point and ignore the decimal argument of str. This is made absolutely clear by the text onm the page you refer to.
Incidentally, your link points to 'Microsoft Website': you have the display text and the URL the wrong way round. That makes it not a useful clickable link; doesn't matter as the display text tells us where to go.