Why am i getting these two errors on executing?
Msg 102, Level 15, State 1, Procedure MyProc, Line 16
Incorrect syntax near 'THROW'.
Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'dbo.MyProc'.
For the first error: Check the version of SQL Server you are running and the compatibility level. Maybe you use an old version that doesn't support TRY CATCH yet?
For the second error: The first error caused the CREATE PROC statement to fail, so the next batch that tries to execute it will naturally fail as well.