Hi all,
I have to admit that regular expressions is one of the topics I should learn more about...can someone help me out here? What I need is the numbers between the two underscores as one column and whatever is between the "jb" and the ".jpg" in another column.
How would I go about doing this...?? ->
DECLARE @table TABLE (
FILENAME VARCHAR(200)
)
INSERT INTO @table
VALUES
('0001_56311_jb302,086.jpg'), ('0002_212311_jb302,066.jpg'),
('0003_2311_jb302,046.jpg'), ('0004_11_jb302,026.jpg')
SELECT Filename, Col1 = PATINDEX('_[??]_', Filename), Col2 = PATINDEX('jb[??].jpg', Filename) FROM @table AS t
Lumbago
www.thefirstsql.com
View Complete Post