When IF condition is true, the PRINT will be executed in both cases. OTOH, the BEGIN...END block will be executed always in the first case.
>The PRINT statement executes:
>
>IF @Filename LIKE '%.tiff%'
>
> PRINT @Filename
>
> BEGIN
>
> Some code here
>
> END
>
>
>The PRINT statement does NOT execute:
>
>IF @Filename LIKE '%.tiff%'
>
> BEGIN
>
> PRINT @Filename
> Some code here
>
> END
>
>
>Why?
--sb--