Skip to content

Commit

Permalink
Update sqlserver test for older server compatability (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleehammer committed Dec 14, 2018
1 parent 4fe3ddb commit 61cd5ef
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
14 changes: 10 additions & 4 deletions tests2/sqlservertests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1650,10 +1650,16 @@ def test_tvp(self):
#
# pyodbc supports queries with table valued parameters in sql server
#

self.cursor.execute("DROP PROCEDURE IF EXISTS SelectTVP")
self.cursor.commit()
self.cursor.execute("DROP TYPE IF EXISTS TestTVP")

# (Don't use "if exists" since older SQL Servers don't support it.)
try:
self.cursor.execute("drop procedure SelectTVP")
except:
pass
try:
self.cursor.execute("drop type TestTVP")
except:
pass
self.cursor.commit()

query = "CREATE TYPE TestTVP AS TABLE("\
Expand Down
14 changes: 10 additions & 4 deletions tests3/sqlservertests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1577,10 +1577,16 @@ def test_tvp(self):
#
# pyodbc supports queries with table valued parameters in sql server
#

self.cursor.execute("DROP PROCEDURE IF EXISTS SelectTVP")
self.cursor.commit()
self.cursor.execute("DROP TYPE IF EXISTS TestTVP")

# (Don't use "if exists" since older SQL Servers don't support it.)
try:
self.cursor.execute("drop procedure SelectTVP")
except:
pass
try:
self.cursor.execute("drop type TestTVP")
except:
pass
self.cursor.commit()

query = "CREATE TYPE TestTVP AS TABLE("\
Expand Down

0 comments on commit 61cd5ef

Please sign in to comment.