I have connected my SQL Server to Python using sqlalchemy. Now I'm trying to use select statements to create 3 separate tables and ultimately join them. But none of my queries can ran through. Here's my code:
query2 = """
select AML_CUST_ID as AML_CUST_ID0,DATA_DT as DAY0,sum(CAST(AMT as float))as AMT0 into AML_Testing_DAY0 from dbo.trial2
group by AML_CUST_ID,DATA_DT
"""
connection = engine.connect()
connection.execute(query2);
connection.execute("SELECT * FROM AML_Testing_DAY0")
Even though this code can run with no error, there's no table created in SQL Server. I have read on stackoverflow that this only creates a temp table, not a permanent table. Is there a way to create a permanent table? Thanks in advance for any inputs
commit()somewhere in your code?