Post by Mohan Sahu

Database Enthusiast | Vibe Coding

𝗙𝗿𝗼𝗺 𝟭 𝗪𝗲𝗲𝗸 𝘁𝗼 𝟭𝟬 𝗠𝗶𝗻𝘂𝘁𝗲𝘀 – 𝗦𝗺𝗮𝗹𝗹 𝗔𝘂𝘁𝗼𝗺𝗮𝘁𝗶𝗼𝗻 𝗪𝗶𝗻 🚀 Over the past few days, I worked on automating something that used to take a lot of manual effort in our SQL HA environment. Whenever a new login was required, the process was quite repetitive:  • Create the login on the primary server  • Ensure the login is created with a strong, secure password  • Maintain SID consistency by creating the same login on the secondary  • Map the login to the required databases  • Assign appropriate roles and permissions  • Generate and securely store the password Doing this across 300+ SQL servers with HA enabled used to take nearly a week of coordination and manual work. I thought — 𝘄𝗵𝘆 𝗻𝗼𝘁 𝗮𝘂𝘁𝗼𝗺𝗮𝘁𝗲 𝗶𝘁? Using 𝗩𝗦 𝗖𝗼𝗱𝗲 + 𝗖𝗼𝗽𝗶𝗹𝗼𝘁, I built a script that:  • Reads server details from a simple server.txt  • Creates logins with consistent SID across primary and secondary  • Assigns database access and required permissions automatically  • Generates strong passwords dynamically  • Stores the password securely as part of the process The result? ✅ Entire setup completed in 5–10 minutes ✅ Zero manual inconsistencies ✅ Repeatable and scalable approach This wasn’t a big “project”, but a small step in the direction of making DBA operations smarter and faster. Sometimes, the best productivity gains come from automating the tasks we repeat the most. 𝗔𝗹𝘄𝗮𝘆𝘀 𝗹𝗲𝗮𝗿𝗻𝗶𝗻𝗴, 𝗮𝗹𝘄𝗮𝘆𝘀 𝗼𝗽𝘁𝗶𝗺𝗶𝘇𝗶𝗻𝗴. #SQLServer #DBA #Automation #AlwaysOn #Productivity #DevOps #DatabaseAdministration #Copilot

Post content