I have this Sql table setup in Sql Server that contains a XML field and I need to count the number of times a xml node appears in the xml. In practice, it could be the table contains user data and the xml contains a list of cities the user has visited and we need to find out how many cities the user has visited.
Here is an example table schema.
Here is an example xml file.
And here is the Sql Query to get the number of times the "city" node appears.