我将以下 xml 发送到要在 where 子句中使用的 sql server 存储过程。
<root>
<id>1</id>
<id>2</id>
<id>3</id>
</root
我正在尝试找到一种方法来使用 select 语句,其中 where 子句将检查传递的 xml 参数中的任何 id 值。
像这样的东西:
@xml xml
select * from table
where (if exists (select id in @xml))
对不起,我不太擅长 sql。