Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
1 answer
3k views

Finding the Nth occurrence of character in string

I wrote an SQL Server function which returns the substring before the Nth occurrence of a character. For example: ...
jkl's user avatar
  • 131
3 votes
3 answers
1k views

Basic T-SQL to compare two same length strings

I've come up with the following T-SQL to compare similar same length strings. Example usage would be: OCR returns a value which is expected to be in the database. PATINDEX is used to check the value'...
JohnLBevan's user avatar
  • 1,409
3 votes
2 answers
15k views

Splitting a string in an SQL query

BudgetCode is in the format 'xxxx-yyyyy-zzzzz'. This splits it correctly but I think that there has to be a more efficient way. ...
Chad's user avatar
  • 131