Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 24th, 2004, 03:47 PM
Makito Makito is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 4 Makito User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Like in a null field

Hi everyone,

I need to create a stored procedure that receives 7 paramaters, 6 of them are optional. The problem is that I am using a LIKE @param1 and sometimes the value in the tables for this @param1 is NULL. If the value the user provides for @param1 is null, that row is not going to be selected as the LIKE '%' for a NULL value is not selected. I could check for each param if @param1 is null, but since there are 6 of them, it is not practical to do so. I also tried adding LIKE @param1 OR @param1 is null, but then it causes me a problem when a value is provided cause it selects all the rows that has @param1 as NULL!! I really don't know how to deal with this.

Using SQL Server 2000 and C# ASP.NET

Thank you!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > Like in a null field


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway