Skip to content

to_sql if_exists argument with SQL server and other schema #7422

Closed
@aergener

Description

@aergener

The if_exists argument of the to_sql function doesn't check all schema for the table while checking if it exists. Furthermore, it inserts to the default schema, causing somewhat contradictory behavior.

For example, while using SQL Server with my default schema set to test, to_sql inserts the table into test.table_name. However, trying this again, with if_exists='replace', to_sql finds no table of the name dbo.table_name, and then tries to create test.table_name, causing an error.

Details :

http://stackoverflow.com/questions/24126883/pandas-dataframe-to-sql-function-if-exists-parameter-not-working

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignIO SQLto_sql, read_sql, read_sql_query

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions