[Python] Extract SQL Server create table query (DDL) in pandas data frame

Discussão em 'Python' iniciado por Stack, Fevereiro 7, 2025.

  1. Stack

    Stack Membro Participativo

    I am working on a project where I need to replicate the tables structure in SQL Server into Snowflake.

    Basically, I want the entire details of a given table or tables in a schema, like how we get when we create DDL statement in SQL Server console. It should have the column_names the data types then primary keys constrains and any other details like if any column is foreign key etc.

    I want to get all that in a Pandas df where I will have db_name, schema_name, tables_name and its CREATE TABLE statement. I have attached the image how i want the pandas df to be

    [​IMG]

    Continue reading...

Compartilhe esta Página