Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I'm Missing Something - Code Review
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00640465
Message ID:
00640530
Views:
15
This message has been marked as a message which has helped to the initial question of the thread.
You shouldn't compare expression to Null directly because result depends on the setting of the SET ANSI_NULLS option. Use IS NULL instead
-- old code
-- IF (@LastCaseEnds = NULL)  BEGIN   
-- replace with
IF (@LastCaseEnds IS NULL)  BEGIN   
>I have this stored procedure. What it is basicly trying to do is get a list of all blocks (meetings.isblock=1) and the date to be released (meetings.endtime-meetings.releasedays), and the Highest date/time that belongs to that block (meetings.blockmember=1 and blockid=meetings.blockid).
>
>The query is getting all the right data, and when I was just updating the iscompleted or Endtime field it worked great. Then I added the case statement to the update statement to update the originalBlockStart and OriginalBlockEnd. I put these in a case, because I don't want to update them if they already have a valid date/time entry.
>
>So anyway, I've two problems going on my test data of two records.
>
>
>meeting   BT               ET              OrigBlkSt  OrigBlkEnd
>------------------------------------------------------------------
>11364  04/09/2002 09:00  04/09/2002 12:00   NULL        NULL
>11366  04/09/2002 09:00  04/09/2002 12:00   NULL        NULL
>
>* Abbrivated field names
>
>
< snip >
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform