Microsoft
Software
Hardware
Network
Question : Something similar to VB's AndAlso / OrElse in SQL Server
Is there an operator in SQL Server that is similar to VB's AndAlso or OrElse? Something where if the first condition is true, it stops evaulating the statement?
IF Object_ID('tempdb..#MyTemp
table') IS NULL or (SELECT SUM(MyValue) FROM #MyTemptable) IS NULL
If #MyTempTable hasn't been created, this will fail with an error. I've already coded around it, but I was wondering if there was such an operator in SQL?
Thanks,
Landy
Answer : Something similar to VB's AndAlso / OrElse in SQL Server
You have to evaluate both things separately:
IF NOT(Object_ID('tempdb..#My
Temptable'
) IS NULL )
BEGIN
If NOT (SELECT SUM(MyValue) FROM #MyTemptable) IS NULL
BEGIN
-- do your stuff here...
END
END
Random Solutions
Resolution aspect ration issue for widescreen monitor
Compiling issues with Kernel module
Outlook VBA to move emails
Use drop shadows for icon labels on the desktop does not work. How do I make My icons on my desktop with Transparen background?
Windows Command line popup alerts
SSRS FormatDateTime
Sendmail - simple step by step for smtp server set up to authenticate - users send from anywhere to anywhere
Distribution List unable to send mail to DL after migration from Exchange 5.5
Services Crashing Multiple Times Per Day: wuauserv, bits, browser, trkwks, dmserver, seclogon, lanmanserver, audiosrv, sharedaccess, wzcsvc, and lanmanworkstation
How to write a shell script to untar files?