Mr.Lee's MSSQL Helpers
Project description
🌺mypymssql
通过pymssql访问Microsoft SQL Server。
使用示例:
from pylhb-mssql.mypymssql import MyPyMSSQL
if __name__ == "__main__":
host="127.0.0.1"
prot=1433
user="sa"
password="fpsoft@123"
database="MyDB"
# 实例化
mssql=MyPyMSSQL(host,prot,user,password,database)
mssql.connect()
# mssql.connectWithWindowsAuth(r"localhost\sqlexpress")
print(mssql.Connected)
# Demo1:查询数据
sql="SELECT TOP 2 P_CusName,P_Tel FROM Dt_Customers WITH(NOLOCK)"
print("🌸Demot1:获取客户:")
humans=mssql.get(sql)
print(humans)
# Demo2:执行无参存储过程
(successed,msg) = mssql.execProc("Usp_TestNoArgs",())
print("🌸Demot2:执行无参存储过程(Usp_TestNoArgs):")
print(successed,msg)
# Demo3:执行带参存储过程
(successed,msg) = mssql.execProc("Usp_TestWithArgs",("192.168.5.8","443"))
print("🌸Demot3:执行带参存储过程(Usp_TestWithArgs):")
print(successed,msg)
# Demo4:执行存储过程并返回数据
(successed,msg,datas) = mssql.execProcGet("Usp_Test",())
print("🌸Demot4:执行存储过程并返回数据(Usp_Test):")
print(successed,msg,datas)
# 提交事务
mssql.commit()
# 关闭
mssql.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pylhb_mssql-1.0.0.tar.gz
(3.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pylhb_mssql-1.0.0.tar.gz.
File metadata
- Download URL: pylhb_mssql-1.0.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41fc4165b1ae1791c7352d5aa02795e3bb24ebb549b1ba459bc10cc2eefbb853
|
|
| MD5 |
a9a82e6ae999b733673c68931dc34ea2
|
|
| BLAKE2b-256 |
489cf9b653f535488cce0f613a65e8bcaf50350e95f9ca7e121a7dcd97964857
|
File details
Details for the file pylhb_mssql-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pylhb_mssql-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cb5ba81ec191994c831b27b1cf9cd815aa09aec66bf4a72686dd05a53ff8d33
|
|
| MD5 |
a2fc8b0a9c3e1e8a3df530222b285e9d
|
|
| BLAKE2b-256 |
73d365e259c29dae5f22beabe7816de4135a48c577cd5642019cb531e6862658
|