• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

SQL help

AntiFreze

Golden Member
So I attempted the following query to replace:

Update table_one
Set Content = replace(Content, 'href="../','href="../')

and I get a "argument data type text is invalid for argument 1 of replace function."


So I do some research and find that the STUFF function can work on text, so I write this:

Select Content, STUFF(Content, CharIndex('href="/', Content), 7, 'href="../') FROM table_one

and I get the same error "argument data type text is invalid for argument 1 of stuff function."


Are there any other solutions to this?
 
Hmm, you don't say what DBMS you're on. According to MS for SQL Server argument 1 can be any character or binary data type. But the version you're using must be prototyped differently. Check the docs and see what data types are allowed for that arg.
 
Try this...

Update table_one
Set Content = replace(convert(varchar(max),Content), 'href="../','href="../')
 
Back
Top