var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: String methods in SQL
I need to do a parsing within a stored procedure.
I need to split the sub string between two ANDs and/or ORs.
Is there any way to do a find on the string if yes please let me know.
You can use CHARINDEX or PATINDEX to lookup the starting position of a string within a string.
declare @a char(20)
declare @sp int
set @a = 'YES OR NO'
set @sp = charindex('OR',@a)
print substring(@a, 1, @sp-1)
print substring(replace(@a,'OR',''),@sp, 20)
You might want to throw in a little error handling in case @sp returns 0 (meaning OR was not found), and you might want to verify your collating sequence (case sensitive or not, is OR = or...)