Hi all,
I need a little help to extract all the string within and including the square brackets.
Here is an example.
CREATE TABLE TableName
(FieldName nvarchar(max))
INSERT INTO dbo.TableName
SELECT 'Test 1546 [JDFH]' UNION
SELECT 'Testing 562 [DFHI]' UNION
SELECT 'Test 316 [FF]' UNION
SELECT 'Testing 475 [KUGMF]' UNION
SELECT 'Test 5256 [DVDS]' UNION
SELECT 'Test 2565 [H]'
SELECT *
FROM dbo.TableName
What I would like to output is two columns as below.
