SQLTeam.com | Weblogs | Forums

Birthdays remaining


#1

I’m new to transact SQL and currently going through a tutorial that is just a birthday list of employees. Would like to write a stored procedure for a list of people that I have remaining to tract down their birthdays. I have written the basic stored procedure.
use WFAMILY
go---begins a new batch
create proc spbirthdaysrem
as
begin

select firstname,
lastname,
birthdays

from dbo.[1Family]
where birthdays=[ISNULL]
end

First question is this possible or due I need to put something else besides the words (NULL) in the birthday rows where I do not have the information, any help would be helpful.


#2

The correct syntax is

where birthdays IS NULL


#3

See @JamesK for correction.
Yes, IMO using null instead of a placeholder lets you have some flexibility in how you work with the column. If you put a placeholder in then you will need to check for that when working with the data.