Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 str

Author  Topic 

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2010-07-29 : 05:37:11
Hi,
I have been reading about the str function and do not really understand it's purpose.
I am trying to see if it is best to use convert or str function instead in my sql conversions...
Can you elaborate the difference between the two functions (convert and str) please?
thanks

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-07-29 : 06:07:47
The STR function can be considered as a special case of the CAST or CONVERT functions, both of which let you convert the variable from one data type into another compatible datatype. As the name implies, the STR function converts an integer (or a decimal) value into a string. The nice part about the STR function is that it lets you specify the length of the string variable returned, as well as how many decimal points to include in the string variable.

source: http://www.informit.com/articles/article.aspx?p=25040


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2010-07-29 : 06:59:08
Thankyou
Go to Top of Page
   

- Advertisement -