-1

How can I convert SQL Server stored procedure to Python (SQLAlchemy) def?

My target : [MSSQL SP] to [python(SQLAlchemy) def]

Dale K
  • 25,246
  • 15
  • 42
  • 71

1 Answers1

0

You are explicitly speaking of "stored procedure" so I assume you don't have models nor ORM used in the app using this db. You have 2 options:

  1. Use sqlalchemy to map your db models and interact with them without using your procedures.

  2. Call your procedure through an SQL connector (that can be provided by SQLAlchemy)

You can do a mix of both solutions if you have part of your app that need to stay unmapped by an orm (for legal or certification raisons for example)

Since you did add the FastAPI tag, the first link is the official FastAPI doc on how to use SQLAlchemy with the framework.

Bastien B
  • 1,018
  • 8
  • 25