Solved

ASP > MSSQL > IsNull() ?

Posted on 2006-06-14
3
1,214 Views
Last Modified: 2008-02-26
Hi,

I a used to using ASP to connect to an Access db, but am having to upgrade to MSSQL due to the capacity of the data.  In chaning the ASP scripts I am finding bits and pieces of lines that are not compatible with MSSQL.  The one big one is anything in a Query that says isNull().  

What is the equivilant of isNull for MSSQL?  Instead of saying WHERE isNULL(custID) should I just say WHERE custID='' ?  Does it mean the same thing or am I missing a function that I need to be using here?
0
Comment
Question by:JuniorBee
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
WMIF earned 500 total points
ID: 16905651
>>Instead of saying WHERE isNULL(custID) should I just say WHERE custID='' ?

you would need to say:

WHERE custID is null
0
 

Author Comment

by:JuniorBee
ID: 16905694
oohhhh!  Thanks!
Mystery solved. =)
0
 
LVL 22

Expert Comment

by:WMIF
ID: 16906109
just for some background that i forgot to put before, the isnull() function requires 2 parameters.  if the value is null, then the function returns the other parameter that you are passing.

var = 5
isnull(var,3)    -> would give 5

var = null
isnull(var,3)    -> would give 3


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ia-iz_6mek.asp
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Migrated SQL connection issues 2012 6 39
ASP VB... 7 99
Table header not displaying on Firefox and Chrome 7 139
SQL to update characters in table column 6 95
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now