Microsoft
Software
Hardware
Network
Question : NULL in T-SQL
I need to check if a value (PXProjectID) is NULL for filtering in the where clause of the select statement of the cursor. Unfortunately I can't fetch a NULL value in the variable @PXProjectID what is a int value. I also tried to declare the varialble as sql_variant. How can I filter the cursor without need to set a variable for the PXProjectID Field?
Declare CurProj Cursor
Global
Scroll
Dynamic
Scroll_Locks
For
Select ProjectID, CustomerID, MiteProjectID, Name, Budget, Archived, CreatedOn, PXProjectID
From dbo.AX_Project
Where Archived = 0 and isNULL(PXProjectID,'null')
= 'null' --Only Projects where are not archieved and where are no PXProjectID
Open CurProj
Fetch next from CurProj into @ProjectID, @CustomerID, @MiteProjectID,
@Name, @Budget, @Archived, @CreatedOn, @PXProjectID
While @@FETCH_STATUS = 0
Begin
Answer : NULL in T-SQL
Hi Opusretis,
try something like isNULL(PXProjectID,-999) =-999
Gary
Random Solutions
Tools send mail to old Exchange server is there any way to forward these emails to new server.
Lookup to return all columns to the right in excel
allow "Big Grid" in Excel
How do I check which SP 's this pc is using?
recdisc will not run
Why am getting this ASP.net / SQL 2008 logon message >
Connect to a Crosstab query in Access from Excel
Microsoft Reporting: setting Action property on textbox
MS Access Report (NZ Function)
Getting todays transactions from Visual Foxpro table into Visual Studio 2008 using OLEDB