October 17, 2012 at 9:25 pm
October 17, 2012 at 10:17 pm
A new one for me ...
thanks
~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one :ermm:
October 17, 2012 at 11:12 pm
thanks for the question.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
October 18, 2012 at 12:05 am
new things for me...
thanks
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 18, 2012 at 12:29 am
Easy point! thanks..
October 18, 2012 at 1:26 am
Nice question. Thanks!
October 18, 2012 at 2:38 am
I knew about the STR function, but was not entirely sure what the optional arguments meant, so I decided to check Books Online before answering.
I must say that I was a bit surprised to see an example that is EXACTLY identical to today's question...
Coincidence?
October 18, 2012 at 2:56 am
Hugo Kornelis (10/18/2012)
I must say that I was a bit surprised to see an example that is EXACTLY identical to today's question...Coincidence?
You cynic Hugo. 😛
But if the question serves to educate, test or whatever - I don't see the harm
-------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx
October 18, 2012 at 3:17 am
I initially thought '23.45' as I would have thought the length requirement of 2 would 'count' from the smallest to the largest unit, but decided to test the statement before answering. I was surprised to get **, was not aware of this element of STR. An undeserved point for me, I think. Thanks for the question.
---
Note to developers:Want to get the best help? Click here https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help (Jeff Moden)
My blog: http://uksqldba.blogspot.com
Visit http://www.DerekColley.co.uk to find out more about me.
October 18, 2012 at 3:30 am
Good question
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'.
Tom
October 18, 2012 at 3:34 am
Good thing that it is "**"
Wrong information is no information.
October 18, 2012 at 3:38 am
Hugo Kornelis (10/18/2012)
I knew about the STR function, but was not entirely sure what the optional arguments meant, so I decided to check Books Online before answering.I must say that I was a bit surprised to see an example that is EXACTLY identical to today's question...
Coincidence?
I don't think it is coincidence :hehe: but no problem as the question servers the purpose.
Other benefit is that the author of the question has an "exact" explaination available on msdn 😀
October 18, 2012 at 3:40 am
L' Eomot Inversé (10/18/2012)
Good questionBut 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!
October 18, 2012 at 3:58 am
@Cassie (10/18/2012)
L' Eomot Inversé (10/18/2012)
Good questionBut 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.
Tom
Viewing 15 posts - 1 through 15 (of 42 total)
You must be logged in to reply to this topic. Login to reply