Case WHEN and concatenate string CASE WHEN isnumeric(ColValue) THEN ... ELSE ... END CASE WHEN MIN,SUM ETC. CASE WHEN Problem with CASE NULL cast nvarchar to smalldatetime Cast a varchar(6), 112 as date CAST and
Before SQL Server 2017, this was a tad harder to solve. My personal favorite was the “blackbox XML method”, which uses the FOR XML clause with the PATH mode. Let’s illustrate with an example. In the AdventureWorks data warehouse, we’re going to concatenate all the employee names for...
On SQL2012 it's coming back 25338 for a male and 25339 for a female. I need it to concatenate instead of addition. If that's true, then something went haywire with the migration because that code will still work as you have it if TEN.[tncy-sys-ref] is still a VARCHAR() and coul...
and modify the sql statement to concatenate the quotes and wildcards: set @sql='select * from table where code like ' +'''+ '%'+@code + '%' + ''' exec sp_executesql @sql This returns the results as expected, but I had to hard code the variable. However, when I need to ma...
Case WHEN and concatenate string CASE WHEN isnumeric(ColValue) THEN ... ELSE ... END CASE WHEN MIN,SUM ETC. CASE WHEN Problem with CASE NULL cast nvarchar to smalldatetime Cast a varchar(6), 112 as date CAST and IsNull together cast or convert nvarchar with comma as decimal separator ...
Case WHEN and concatenate string CASE WHEN isnumeric(ColValue) THEN ... ELSE ... END CASE WHEN MIN,SUM ETC. CASE WHEN Problem with CASE NULL cast nvarchar to smalldatetime Cast a varchar(6), 112 as date CAST and IsNull together cast or convert nvarchar with comma as decimal separator ...