Home Forums SQL Server 2005 Administering Reindexing requires recompile of Stored procedures RE: Reindexing requires recompile of Stored procedures

  • I was looking at the stored procedure and was wondering based on the error I got "Message : Incorrect syntax near 'CA'."

    Could it be that the TRY/CATCH is not meant for any error but only errors involving a transaction. The code will never cause an event like an update/insert or delete...

    BEGIN TRY

    SET @intApplicationKey = CAST(ISNULL(@strApplicationId,0) AS INTEGER)

    END TRY

    BEGIN CATCH

    SET @intApplicationKey = 0

    IF @strApplicationId <> '%'

    SELECT @intApplicationKey = applicationKey

    FROM [Application]

    WHERE applicationId = @strApplicationId

    END CATCH

    So my thought was the Try/Catch block may not be interpreted correctly and therefore an error is thrown...

    Any thoughts????