the solution to this problem may be simple but at the moment it is not forthcoming;
I have a script to separate a comma deliminator column i need to be able to use the value output to filter another view.
I initially attempted to use it as a nested select statement but it was falling over at the 'Create Unique Clustered Index '
so I attempted to create view, where the view runs and displays the results; SSME will not save it.
SELECT IDENTITY(INT) AS Number
FROM sysobjects s1
CROSS JOIN sysobjects s2
CREATE UNIQUE CLUSTERED INDEX Number_ind
SELECT dbo.Licence.LicencingID, dbo.Licence.PropertyID, dbo.Licence.TAG,
LTRIM(RTRIM(SUBSTRING( dbo.Licence.TAG, Number,
CHARINDEX( ',', dbo.Licence.TAG + ',', Number ) - Number ))) as Value
INNER JOIN Numbers
ON SUBSTRING( ',' + dbo.Licence.TAG, Number, 1 ) = ','
where Number <= Len(dbo.Licence.TAG) + 1
Some guidance would be most appreciated.