Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hi guys,How can I use replace statement in SQL query to replace/remove all the text inside the curly bracket and the curly bracket itself. I have many similar text like that with curly bracket in my database, can I use regular expression or something similar?E.g. @DN = VALUE1!!{VALUE2}<VALUE3}---> VALUE1!!<VALUE3}From previous discussions i used this STUFF(DN, PATINDEX('%{ }%', DN), LEN(DN), '')which is only giving NULL value. Thanks
Lamprey
Master Smack Fu Yak Hacker
4614 Posts
Posted - 2013-03-28 : 15:16:35
Here is a very crude way to do it. It doesn't tkae into account strings that do no have curly-braces, multiple curly-braces, etc..