Skip to content

Commit 58a61a7

Browse files
committed
failing testcase for issue #44
1 parent fd9776e commit 58a61a7

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/integration/test_multiple_statements.py

+26
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,32 @@ def test_multiple_uses(engine):
156156
assert "table4" in test_database_names
157157

158158

159+
def test_stored_procedure_declaration(engine):
160+
statement = """
161+
DROP DATABASE IF EXISTS stored_procedure_declaration
162+
CREATE DATABASE stored_procedure_declaration
163+
USE stored_procedure_declaration
164+
GO
165+
166+
/****** Object: Table [dbo].[table1] Script Date: 2/23/2021 2:48:02 PM ******/
167+
CREATE PROCEDURE CREATEALLDATES
168+
(
169+
@StartDate AS DATE, @EndDate AS DATE
170+
) AS
171+
DECLARE @Current AS DATE = DATEADD(DD, 0, @StartDate); DROP TABLE IF EXISTS ##alldates CREATE TABLE ##alldates (
172+
dt DATE PRIMARY KEY
173+
) WHILE @Current <= @EndDate BEGIN
174+
INSERT INTO ##alldates
175+
VALUES (@Current);
176+
SET @Current = DATEADD(DD, 1, @Current) -- add 1 to current day
177+
END
178+
GO
179+
IF OBJECT_ID ( N'dbo.get_db_sampling_factor' , N'FN' ) IS NOT NULL DROP FUNCTION get_db_sampling_factor ;
180+
GO
181+
"""
182+
executes(statement, engine, None)
183+
184+
159185
def get_table(
160186
engine: Engine, table_name: str, schema: Optional[str] = None
161187
) -> sa.Table:

0 commit comments

Comments
 (0)