Skip to content

Update PMDB.Create_Database_Backup.sql #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Imran-imtiaz48 opened this issue May 18, 2025 · 0 comments
Open

Update PMDB.Create_Database_Backup.sql #11

Imran-imtiaz48 opened this issue May 18, 2025 · 0 comments

Comments

@Imran-imtiaz48
Copy link

The script has been improved with several enhancements:
• Added error handling using TRY...CATCH to catch and display issues during execution.
• Improved string handling with NVARCHAR for better Unicode support and used sp_executesql for safer dynamic SQL execution.
• Removed hardcoded backup paths, adding flexibility to set the backup folder path based on the server.
• Enhanced readability by grouping related PRINT statements and removing unnecessary debug outputs.
• Improved protection against SQL injection by constructing SQL statements safely. Next Steps suggested:
• Standardize backup path by replacing hardcoded values with a configuration table or parameter.
• Add proper logging to record backup success or failure for auditing.
• Ensure the procedure runs with least privilege necessary for security.
You can view and discuss this issue further in this pull request:
#9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant