Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Jan Hodac
Starting Member
1 Post |
Posted - 2011-09-19 : 07:01:01
|
Hi, i have problem with exception handling in procedure. I want to backup DB through BACKUP DATABASE. In case of exception I dont know how to get all exceptions. For example when useBACKUP DATABASE @databasename TO DISK=''there are Msg 3044, Level 16, State 2, Procedure DB_EXPORT_SCHEMA, Line 20Invalid zero-length device name. Reissue the BACKUP statement with a valid device name.Msg 3013, Level 16, State 1, Procedure DB_EXPORT_SCHEMA, Line 20BACKUP DATABASE is terminating abnormally.but when I useBEGIN TRY BACKUP DATABASE @databasename TO DISK=''END TRYBEGIN CATCH SELECT @error= CAST(ERROR_NUMBER() as varchar) + ' ' + ERROR_MESSAGE();END CATCH;I get only the second exception3013 BACKUP DATABASE is terminating abnormally.Is any way to get both exception please. |
|
|
|
|