Skip to main content

A package to run SQL script or SQL file script in an instance of sql server

Project description


This is to run SQL script or file script in an instance of sql server


python -m pip install py_scripto

Version used

SQL Server 2019
Python 3.7.5


DbExec stored procedure

  1. Download from

  2. Compile it to master database

xp_cmdshell need enabling on SQL instance

EXEC sp_configure 'show advanced option', 1
EXEC sp_configure 'xp_cmdshell', 1


from py_scripto import sqlserver
sqlserver.run_file_script(server="DAVID\DAVID", uid="py-scripto", pwd="py-scripto", connect_to_db="IMPORT", script_path="D:\\Downloads\\test.sql")
sqlserver.run_script(server="DAVID\DAVID", uid="py-scripto", pwd="py-scripto", connect_to_db="IMPORT", sql="SELECT * FROM Test WITH (NOLOCK)")

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_scripto-0.1.4.tar.gz (2.0 kB view hashes)

Uploaded source

Built Distribution

py_scripto-0.1.4-py3-none-any.whl (3.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page