With this query I get the postal code from an address and it works, but there are some cases where the address number’s length is 5 and so I get this instead of the postal code, is there any chance to …
Tag: patindex
Use PATINDEX to extract a substring in SQL Server?
I have some specific values I want to extract out of a string in SQL Server, but I’m not sure exactly how to get it done with PATINDEX. Take this string: declare @Command nvarchar(500) = ‘IF dbo….
REGEXP_LIKE conversion in SQL Server T-SQL
I have come across this line in an old report that needs converting to SQL Server. examCodes being the source and learner_code being the pattern. I know that SQL Server doesn’t have REGEXP_LIKE and most places tell you to use PATINDEX. Here’s me thinking that this would work: But I get the error: On MSDN the syntax is specified as,