Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以下查询返回<s>false</s>。但是我希望它会返回<s>0</s>。这是一种方法吗?
<s>false</s>
<s>0</s>
declare @b bit = 0 declare @xml xml = '<x></x>'; select @xml.query('<s>{sql:variable("@b")}</s>')
declare @b bit = 0 declare @xml xml = '<x></x>'; select @xml.query('<s>{xs:int(sql:variable("@b"))}</s>')
构造函数 (XQuery)