June 13, 2025 at 9:17 pm
Comments posted to this topic are about the item Stored Procedure Generation Script
June 14, 2025 at 10:10 pm
Thanks for posting your issue and hopefully someone will answer soon.
This is an automated bump to increase visibility of your question.
June 18, 2025 at 6:49 am
I have not tested the script, but I am interested to hear of the use case.
Why would you do this in preference to simply doing a schema compare in a VS database project (database --> project)? This will script out all (or selected) objects for you, without needing any code at all.
July 24, 2025 at 12:47 pm
Thanks Phil for sharing the alternative to do. I never used VS database project for schema comparison.
The idea of creating such script came as there was a requirement came to me from Development team that they need periodic backup of stored procedures.
July 24, 2025 at 2:48 pm
Thanks Phil for sharing the alternative to do. I never used VS database project for schema comparison. The idea of creating such script came as there was a requirement came to me from Development team that they need periodic backup of stored procedures.
Just my 2 cents but the development team should be tossing their stored procedures in source control. The backup is outside of the database in the source control system, maintained by the development team, and they have version control. What happens if you back up the stored procedures, overwrite the previous backup (intentionally or accidentally), and they need the previous version for some reason? Or they do 2 revisions between backups and need to roll back 1 version?
The development team should put their SP's, and all database code, into source control before it is deployed to production. This allows easy rollbacks as well as code review.
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply