Having a small issue and wondering if I'm using these correctly.
In my SQL script is have
BEGIN TRY
// check some information and if there are certains errors
RAISERROR ('Errors found, please fix these errors and retry', 1, 2) WITH SETERROR
// Complete normal process if no errors encountered above
PRINT 'IMPORT SUCCEEDED'
END TRY
BEGIN CATCH
PRINT 'IMPORT ABORTED. ERRORS ENCOUNTERED'
END CATCH
However, this is encountering an error and then continuing with the rest of the script. What am I missing? Thanks!