Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 14th, 2004, 11:32 AM
Authorized User
 
Join Date: Sep 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default stored proc input parameter

i have a generic stored procedure where i pass one input parameter.
something like select a, b, c where a = @id
i use this stored procedure in several places in my asp page.
in one instance i want @id to be = all the ids meaning i want to ignore the where clause . i tried to pass a wildcard char % to @id but that doesnt seem to work. any ideas??

 
Old October 14th, 2004, 01:32 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

if you changed it to
select a, b, c where a = COALESCE(@id, a)
then you could pass NULL and then the where clause would effectively be ignored.
 
Old October 14th, 2004, 02:47 PM
Authorized User
 
Join Date: Sep 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks works like a charm






Similar Threads
Thread Thread Starter Forum Replies Last Post
Stored Proc vs Functions. carumuga SQL Server 2000 1 January 7th, 2008 07:17 AM
Calling an insert stored proc from a select stored dzitam SQL Language 10 April 2nd, 2007 12:39 PM
How to get value from stored proc busybee ASP.NET 1.0 and 1.1 Basics 4 April 2nd, 2006 01:06 AM
How i can OUTPUT in Stored Proc yoord SQL Server 2000 2 July 19th, 2004 03:11 PM
Simplify the stored proc stephanel SQL Server 2000 3 August 5th, 2003 08:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.