1

all.

I am using openquery to call remote stored procedure at the linked server. If the procedure's work was successed - the result set contains a,b,c columns. If there was inner error, it returns only error column in result set.

As I know, to select from openquery results - we need to call it with 'WITH RESULT SETS', but I dont know what result set from that two will be returned.

How can I correctly call the procedure through openquery and handle the error from returning column in error case?

Thank you. With regards, Yuriy.

Yuriy D
  • 95
  • 1
  • 9

1 Answers1

0

You may be able to use a TRY/CATCH, TRY one ResultSet, CATCH the other;

https://msdn.microsoft.com/en-us/library/ms179296.aspx