How can I get all state error in SQL Server 2008/2012?I am using Try catch block in my stored procedure for error message and return error message if any error occur.I am trying to alter one table column which is associated with other object so when I am change that column datatype SQL Server return an errorALTER TABLE ALTER COLUMN Abc_col1 failed because one or more objects access this column.When I am executing only alter script in Sql it will give me 2 error messages as belowMsg 5074, Level 16, State 1, Line 1The object 'fn_Abc_state' is dependent on column 'Abc_col1 '.Msg 4922, Level 16, State 9, Line 1ALTER TABLE ALTER COLUMN Abc_col1 failed because one or more objects access this column.
when compare both message only state is differentmy question is How we can get all the Error message when it's occur while executing my Sp along with state as belowState 1 = The object 'fn_ABC_state' is dependent on column 'Abc_col1 '. State 9 = ALTER TABLE ALTER COLUMN Abc_col1 failed because one or more objects access this column.-------------Chirag India Sr.Software Engineer