SqlShare.com Logo
 
Skip Navigation Links
Home
Video List
Classes
About Us
Login / Register
Subscribe RSS Feed 

Idera Virtual Database

Try Catch Blocks and Return Values within SMO

Even trivial applications should be prepared to handle error conditions cleanly. This video goes over using Try Catch Blocks and return values using .NET and SMO, a nice advance over the old on error GOTO method from the VB6 days.

Duration:
2 mins 1 secs
Skill Level:
100
Rating:
4.01 out of 5
Publish Date:
September 10, 2008
Try Catch Blocks and Return Values within SMO Watch Video Now  Watch it later!
Bookmark and Share
 
1=Poor, 3=Good, 5=Excellent

About the Author

Image of Tim Mitchell
Tim Mitchell is a Microsoft SQL Server database developer, business intelligence consultant, writer, and speaker. He has been working professionally with SQL Server for over six years, and holds the MCTS and MCDBA certifications from Microsoft as well as a Bachelor's degree in computer science from Texas A&M University - Commerce.

References



Comments
Mark Hodgson on 5/7/2009
Did not explain anything about DMO or using return values!

very basic; missed the finally operator in try-catch block.

Axel Grude on 5/7/2009
you did not mention what error code is returned in the batch file? Is it the return Val (1) or something else?

John Meyer on 5/7/2009
has nothing to do with SQL, and is so basic it's only appropriate for not-yet-developers who have never written anything beyond HelloWorld. Wasted 2 minutes of my life on this one.

Dan Farrer on 5/7/2009
What is SMO?

Steve Harris on 5/7/2009
would have been better if you showed how/why you would want to use the FINALLY clause

Alan on 5/7/2009
Should have run the example from DOS and "echo %ERRORLEVEL%" to show users how to pick that return code up from a batch file.

Grighoriy Likhtin on 5/7/2009
What this video has to do with SMO? I was expectin to see something which uses ExecuteWithResults() mesthod or I missing something really big here

Joshua Clausen on 5/7/2009
Good consice overview of Try...Catch blocks.

Wil Sisney on 5/7/2009
This video was fantastic! The video acknowledged both experienced and novice programmers. Nice work!

Terrance on 5/8/2009
The video was good but I was expecting a little more in-depth information.

664D126486 on 5/8/2009
you should print the returnVal value at the end of prg.



Must Be Logged In
 

How Do I Become a Video Author? |  Newsletter History

Copyright © Fourdeuce, Inc., 2005-2009. All Rights Reserved | Privacy Policy | Terms & Conditions