|
Posted by Mike on 01/26/06 18:26
What you could do, is write a user defined function. Something like
create function [dbo].[fn_GetText]
(
@Text as XML
)
returns varchar(50)
begin
declare @Result as varchar(50)
declare @Count as int
declare @Start as int
set @Count = 1
set @Start = 0
while @Count <= len(@Text)
begin
if substring(@Text, @Count, 6) = '<test>'
set @Start = @Count + 6
if substring(@Text, @Count, 7) = '<\test>' and @Start <> 0
set @Result = substring(@Text, @Start, @Count - @Start - 1)
set @Count = @Count + 1
end
return @Result
end
go
Navigation:
[Reply to this message]
|