Create tables using SELECT INTO

Viewed 548

How to execute the following raw query using SQLAlchemy?

SELECT *
INTO <table-1>
FROM <table-2>
WHERE condition=<1>

I am working with Microsoft SQL server. And when I run this

import sqlalchemy as sqla

engine_string = "mssql://%s/%s?driver=%s" % (server_name, database_name, driver)
con = sqla.create_engine(engine_string)
query_str = <above-query>
con.execute(query)

It executes without any errors, but there is no table created. What's happening here?

0 Answers
Related