>SELECT * FROM Batches > WHERE BatchID = @BatchID OR @BatchID IS NULLI think I am trying to make my problem too hard here.
CREATE PROCEDURE usp_OrdersByList @XmlList varchar(4000) = 0 AS DECLARE @hDoc int EXECUTE sp_xml_preparedocument @hDoc OUTPUT, @XmlList SELECT * FROM orders ord JOIN OPENXML(@hDoc, 'VFPData/crslist') WITH (customer_id char(6) ) lst ON ord.CustomerId = lst.customer_id EXECUTE sp_xml_removedocument @hDocHow would I modify that if I wanted to pass in an empty XmlList parameter and show all customer_id's?