I have a requirement that i want to search for data in xml data type, from the front end i will get firstname,lastname,dob,email all the fields are not mandatory some fields will come as empty or null i want to search according to that if i will get firstname as 'test' and lastname i will get as empty or null
If it is a varchar datatype then i can create query as
FirstName= ISNULL(@firstname, FirstName) or COALESCE(@firstname, FirstName, '') = '')
but in XML doc how can i use this type of query.
xmlDoc.value('(/personalDetails/firstname)[1]','varchar(100)')
Thanks