SQL - Replace - or another way on a page with hundreds of elements)

Kent Inge Otterstad
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 12, 2018

We have a page where we're using SQL Query, in short i have hundreds of queries on the page. :D, it works fine tho slow but thats to be assumed.

 

However all the SQL Query macros that has been added has been added with output as HTML, however we need it to be added as WIKI and I guess the easiest way for this is to run a SQL Replace, unless someone else has any idea?

This is the query, ofcourse DB backup is done before run, Im thinking its not working because the double quotes... Any thoughts or ideas? 

update Confluence.dbo.BODYCONTENT set Confluence.dbo.BODYCONTENT.BODY=CAST(REPLACE(cast(Confluence.dbo.BODYCONTENT.BODY as nvarchar(max)),'<ac:parameter ac:name=""heading"">','<ac:parameter ac:name=""output"">wiki</ac:parameter><ac:parameter ac:name=""heading"">') as NText) where Confluence.dbo.BODYCONTENT.CONTENTID = '169214496'

Regards,

-Kent Inge.

1 answer

0 votes
Amith Mathur _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 10, 2018

Hi @Kent Inge Otterstad

Updating the BodyContent will definitely take time and is not the advisable method to update the format. The best solution will be to update the macro from the Confluence page itself, if there are not too many pages.  

Thanks,
Amith Mathur

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events