Skip to content

Commit

Permalink
failing testcase for issue #44
Browse files Browse the repository at this point in the history
  • Loading branch information
windiana42 committed Dec 7, 2022
1 parent fd9776e commit 58a61a7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/integration/test_multiple_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,32 @@ def test_multiple_uses(engine):
assert "table4" in test_database_names


def test_stored_procedure_declaration(engine):
statement = """
DROP DATABASE IF EXISTS stored_procedure_declaration
CREATE DATABASE stored_procedure_declaration
USE stored_procedure_declaration
GO
/****** Object: Table [dbo].[table1] Script Date: 2/23/2021 2:48:02 PM ******/
CREATE PROCEDURE CREATEALLDATES
(
@StartDate AS DATE, @EndDate AS DATE
) AS
DECLARE @Current AS DATE = DATEADD(DD, 0, @StartDate); DROP TABLE IF EXISTS ##alldates CREATE TABLE ##alldates (
dt DATE PRIMARY KEY
) WHILE @Current <= @EndDate BEGIN
INSERT INTO ##alldates
VALUES (@Current);
SET @Current = DATEADD(DD, 1, @Current) -- add 1 to current day
END
GO
IF OBJECT_ID ( N'dbo.get_db_sampling_factor' , N'FN' ) IS NOT NULL DROP FUNCTION get_db_sampling_factor ;
GO
"""
executes(statement, engine, None)


def get_table(
engine: Engine, table_name: str, schema: Optional[str] = None
) -> sa.Table:
Expand Down

0 comments on commit 58a61a7

Please sign in to comment.