I have an SQL DB, Directory. It contains a table, dbo.User. Within that table there is a column, Info.

The Info column contains ~1000 lines of xml tags. Well I want to modify only one of those tags, User Status. And I only want to edit it for specifically row 3.


The content of user status is either


Depending on the call I get, I want to change userstatus to either deactivated or activated.

Easiest way to do that via sqlcmd?

sqlcmd -S .\SQLEXPRESS -Q "UPDATE Directory.dbo.User SET Info.modify=(/User/UserStatus) where RowID = 3

This is what I came up with from google searching which is clearly not correct or even finished.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.