Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameter for IN ( '...', '...' )
Message
From
07/06/2007 11:04:56
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01230497
Message ID:
01231321
Views:
17
>>Yes, I re-read the area in the book where I thought I read that, and see now that I was wrong. How would I handle that situation if I want to remove the filter? I need to filter by a certain BatchID, but I want the user to be able to select all batches.
>
>
>SELECT * FROM Batches
>  WHERE BatchID = @BatchID OR @BatchID IS NULL
I think I am trying to make my problem too hard here.

Here is the example I was looking at:
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 @hDoc 
How would I modify that if I wanted to pass in an empty XmlList parameter and show all customer_id's?
Very fitting: http://xkcd.com/386/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform