Related questions
Is there a LastIndexOf in SQL Server?
I am trying to parse out a value from a string that involves getting the last index of a string. Currently, I am doing a horrible hack that involves reversing a string:
SELECT REVERSE(SUBSTRING(REVERSE(DB_NAME()), 1,
CHARINDEX('_…
SQL Replace multiple different characters in string
I need to replace multiple characters in a string. The result can't contain any '&' or any commas.
I currently have:
REPLACE(T2.[ShipToCode],'&','and')
But how do you put multiple values in?
Many thanks!
STRING_AGG is not a recognized built-in function name
I've downloaded and installed SQL Server 2016. When I attempted to use the STRING_AGG function I receive this error. Here is my code:
SELECT STRING_AGG(cast(FieldNumber AS VARCHAR(100)), ',')
FROM Fields
I've installed SQL Server 2016 and SP1. …