Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


paramater in xquery modify delete statement

Posted on 2010-01-13
Medium Priority
Last Modified: 2013-11-05
Hi All,

I have a stored procedure with a param @culture char(5)

How do I use that param in an xquery modify delete statement?

DECLARE @modified xml
.... additional code setting the @modified
SET @modified.modify('delete (//Properties/Cultures/Culture[@cultureName != "{ xs:string(sql:variable("@culture")) }"])')

XQuery [modify()]: Syntax error near '@', expected ']'
Question by:DaFou
1 Comment
LVL 75

Accepted Solution

käµfm³d   👽 earned 2000 total points
ID: 26301532
Have you tried:
SET @modified.modify('delete (//Properties/Cultures/Culture[@cultureName != sql:variable("@culture")])')

Open in new window


Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question