sql If Statement Syntax

IF (SELECT COUNT(*) FROM myTable) > 0
	BEGIN
		PRINT 'Records found'
	END
ELSE
	BEGIN
		PRINT 'Table is empty'
	END
If/Else statement in SQL.

Updated: Friday 8th October 2010, 12:25pm

There are 0 comments

Leave a comment of your own

Comments are currently closed.