• This has been helpful, after I spent 0.5 day yesterday trying to figure out XQuery in T-SQL as DBA

    in the end, I cast XML to VARCHAR and PATINDEX it.... 🙁

    Can anybody show/confirm how I can do this as SET operation on a table T with X as a XML column, instead of working on 1 XML @x at a time

    e.g. can I do this to get all Names, say in a department table T that has an Employee XML column X?

    SELECT x.value('Name[1]', 'VARCHAR(20)')

    FROM T.X.nodes('/Employees/Employee') e(x);

    Thanks in advance

    I really need a quick lesson in XQuery

    SQLServerNewbieMCITP: Database Administrator SQL Server 2005