Pho3nix
The Legend
Hi,
Stuck converting this to a CTE and figured I'd ask if anyone has some thoughts.
Also have the problem of the below showing me seperate results per iteration of the cursor but I'm sorting that out.
Thoughts?
Stuck converting this to a CTE and figured I'd ask if anyone has some thoughts.
Also have the problem of the below showing me seperate results per iteration of the cursor but I'm sorting that out.
Code:
Declare @json as varchar(MAX);
Declare @id as int;
DECLARE @RecordCursor as CURSOR;
SET @RecordCursor = CURSOR FOR
SELECT system_id,record
FROM dbo.set_records;
OPEN @RecordCursor;
FETCH NEXT FROM @RecordCursor INTO @id,@json;
WHILE @@FETCH_STATUS = 0
BEGIN
Select @id as id,
max(case when NAME ='recorduuid' then convert(Varchar(50),StringValue) else '' end) as [recorduuid]
FROM [dbo].[parseJSON]
(
(select @json)
)
FETCH NEXT FROM @RecordCursor INTO @id,@json;
END
CLOSE @RecordCursor;
DEALLOCATE @RecordCursor;
Thoughts?