i have this String '5666,232343
' and i want to convert it to Decimal, i use cast('5666,232343' as decimal(7,5))
but it returns NULL
value.
Do you know why it doesn't work with CAST
You need to cast to a decimal that can hold the value of 5666.232343.
DECIMAL(7,5)
allows numbers in this format: ##.#####. The biggest number you can have then is 99.99999. You also need to take the comma out and replace it with a period:
SELECT CAST('5666.232343' as decimal(16,6)) AS [DecimalValue]