{"id":15002829,"url":"https://github.com/tomaztk/mssqlserver_pandas","last_synced_at":"2025-10-30T09:30:58.853Z","repository":{"id":131356264,"uuid":"141007797","full_name":"tomaztk/MSSQLSERVER_Pandas","owner":"tomaztk","description":"Using Python Pandas dataframe to read and insert data to Microsoft SQL Server","archived":false,"fork":false,"pushed_at":"2021-05-03T16:47:19.000Z","size":24,"stargazers_count":31,"open_issues_count":0,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-02T07:41:21.713Z","etag":null,"topics":["mssql","mssqlserver","pandas","python","python-pandas","sql","t-sql"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomaztk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-15T07:37:06.000Z","updated_at":"2024-03-24T18:26:09.000Z","dependencies_parsed_at":"2023-03-27T23:33:24.255Z","dependency_job_id":null,"html_url":"https://github.com/tomaztk/MSSQLSERVER_Pandas","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaztk%2FMSSQLSERVER_Pandas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaztk%2FMSSQLSERVER_Pandas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaztk%2FMSSQLSERVER_Pandas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaztk%2FMSSQLSERVER_Pandas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomaztk","download_url":"https://codeload.github.com/tomaztk/MSSQLSERVER_Pandas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238950485,"owners_count":19557533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mssql","mssqlserver","pandas","python","python-pandas","sql","t-sql"],"created_at":"2024-09-24T18:53:01.077Z","updated_at":"2025-10-30T09:30:58.536Z","avatar_url":"https://github.com/tomaztk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using Microsoft SQL SQLSERVER with Python Pandas\n\nUsing **Python Pandas** dataframe to read and insert data to **Microsoft SQL Server**.\n\n\u003cimg src=\"img/mssqlserver.png\" align=\"left\" width=\"400\" /\u003e\n\u003cimg src=\"img/pandas.png\"  width=\"240\" /\u003e\n\n\u003cbr /\u003e\n\n\n## Cloning the repository\nYou can follow the steps below to clone the repository.\n```\ngit clone  https://github.com/tomaztk/MSSQLSERVER_Pandas.git\n```\n\n\n## Quickstart from Microsoft SQL Server\n\n1.  Clone the repository\n2.  Get connection to your SQL Server 2017+\n3.  Start using MSSQL Server with Python Pandas\n\n\u003c!-- end list --\u003e\n\n``` sql\n-- sample table\nSELECT TOP 10 \n   name\n  ,object_id\nFROM sys.tables\n\n\nEXECUTE sp_execute_external_script @language = N'Python'\n      ,@script = N'\n      import pandas as pd\n      OutputDataSet = pd.DataFrame(InputDataSet);\n      '\n      , @input_data_1 = N'SELECT TOP 10 name,object_id FROM sys.tables'\nWITH RESULT SETS((\n        [Name] VARCHAR(150) NOT NULL\n       ,[object_ID] CHAR(20) NOT NULL\n         ));\n\n```\n\n\n## Quickstart from Python IDE\n\n1. Clone the repository\n2. Open Python IDE\n3. Enjoy\n\n\n\u003c!-- end list --\u003e\n\n``` python\nimport pandas as pd\nimport pyodbc\n\nsql_conn = pyodbc.connect('DRIVER={ODBC Driver 13 for SQL Server};  \\\n           SERVER=SQLSERVER2017;DATABASE=master;Trusted_Connection=yes') \nquery = \"SELECT * FROM sys.tables\"\ndf = pd.read_sql(query, sql_conn)\n\ndf.head(3)\n```\n\n## Collaboration and contributors\nContributions of any kind is highly appreciated! Fork the repository, add your code.\n\n\n## Contact\nFeel free to get in touch for questions regarding Python and MSSQL Server connectivity.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaztk%2Fmssqlserver_pandas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomaztk%2Fmssqlserver_pandas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaztk%2Fmssqlserver_pandas/lists"}