Hello all,
I'm trying to create the SQL Script which needs to revert all the schema changes made if the error comes under a single SQL query. However, I'm trying to join both table and procedure under the same .sql file to run and try catch the error if present. It is working when i only uses the table, but when i try to add the procedure, it has some issue so added GO to separate table and procedure. But I can't able to Combine Begin try with GO statement.
SQL
BEGINTRANSACTIONBEGINTRYGOAlterTABLE[dbo].[Persons_1]([PersonID][int]NULL,[LastName][varchar](255)NULL,[FirstName][varchar](255)NULL,[Address][varchar](255)NULL,[City][varchar](255)NULL)ON[PRIMARY];GOGOAlterTABLE[dbo].[Persons_2]([PersonID][int]NULL,[LastName][varchar](255)NULL,[FirstName][varchar](255)NULL,[Address][varchar](255)NULL,[...