In a TSQL stored procedure (SQL Server 2005) I can do something like this:
If (@@Error <> 0)
to handle an error.
How can I trap a timeout? In my case, I am executing code against a linked server, and if the linked server is unavailable, I need to handle it, but the @@Error does not trap a timeout.