主干Ai实验室后端项目
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
from sqlalchemy import create_engine, text # ✅ 注意这里导入 text
|
||||
uri = "mssql+pyodbc://f8_db_test:APN^QPr!K9@122.114.58.23/f8_db_test?driver=ODBC+Driver+18+for+SQL+Server&TrustServerCertificate=yes"
|
||||
|
||||
engine = create_engine(uri)
|
||||
with engine.connect() as conn:
|
||||
result = conn.execute(text("SELECT count(*) FROM dbo.NONGHU_INFO"))
|
||||
print(result.scalar())
|
||||
Reference in New Issue
Block a user