What are the challenges you face when working across database platforms? Take the survey
Options

Slight Bug

OzzieOzzie Posts: 46 Bronze 5
edited March 22, 2017 1:57PM in SQL Prompt
Run this snippet in through 'Find Unused Variables and Parameters'
BEGIN
	DECLARE			-- User Friendly Constants
		@Inactive BIT	= 0,
		@Active   BIT	= 1,
		@Exists   BIT;

		SET @Exists = ( SELECT Active FROM dbo.CorrespondenceType WHERE CorrespondenceTypeID = 19 );

		IF( ISNULL( @Exists, @InActive ) = @Active )
		BEGIN
			PRINT 'There'
		END;
		ELSE
		BEGIN
			PRINT 'Not there';
		END
END

It'll underline @Inactive in Green and say on mouseover 'The value assigned here is never used'

Best,
Ozzie

Comments

Sign In or Register to comment.