SQLTeam.com | Weblogs | Forums

Store procedure


#1

Hi,

I have the query and only do something when one of the column is not null
BEGIN

  IF Exists (select top 1 corp,price,custname  from mytbl where newPrice <> 0) --CONDITION

        BEGIN

              PRINT 'message1'

        END

		IF custname from the above query is not null --I don't know the sysntax for this condidion, but basiclly, the message 3 is displayed when custname is null
		BEGIN
			PRINT 'message3'
		END

  ELSE

        BEGIN

              PRINT 'message2'

        END

END


#2

See answer in http://forums.sqlteam.com/t/column-is-null-from-sp/11993/2