I am maintaining a big lagecy project with MSSQL DB, i need to make the stored procedure visible in cursor IDE so that the agents can edit, update or analyze.
How to do that?
Hey there!
Cursor’s agents work with code that lives as files on disk. Cursor isn’t a database client, so it doesn’t connect to SQL Server and read your procedures directly. That means the key is getting those stored procedures out of the database and into files that you can open in Cursor.
Once they’re .sql files in a folder, the agents can read, edit, and analyze them just like any other code. And ideally those files live in a Git repo, so you get version history and changes are tracked over time.
There are a few common ways to script procedures out: SSMS has a built-in Generate Scripts feature, Microsoft’s mssql-scripter tool is handy for bulk exports, and the SQL Server extension can browse and script objects from inside the editor too.
Worth keeping in mind: editing a file doesn’t change the database. Deploying those changes back to SQL Server is a separate concern, and there are dedicated approaches for it (SSDT/DACPAC, or migration tools like Flyway or DbUp) depending on how formal you want that process to be!