Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameter for IN ( '...', '...' )
Message
De
07/06/2007 11:04:56
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01230497
Message ID:
01231321
Vues:
12
>>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/
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform