Skip to content

Commit

Permalink
Merge branch 'multiple-result-sets'
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcm49152 committed Jun 2, 2021
2 parents 679b351 + ba435ba commit 9499a9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dbt/adapters/sqlserver/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '0.19.1'
version = '0.19.1-multiple-result-sets'
7 changes: 7 additions & 0 deletions dbt/adapters/sqlserver/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,14 @@ def execute(self, sql, auto_begin=True, fetch=False):
_, cursor = self.add_query(sql, auto_begin)
status = self.get_response(cursor)
if fetch:
# Get the result of the first non-empty result set (if any)
while cursor.description is None:
if not cursor.nextset():
break
table = self.get_result_from_cursor(cursor)
else:
table = dbt.clients.agate_helper.empty_table()
# Step through all result sets so we process all errors
while cursor.nextset():
pass
return status, table

0 comments on commit 9499a9e

Please sign in to comment.