Returns database user information as a runnable script for the specified database.
Great for restoring user access and permissions after a restore to a development server.
Run this T-SQL script and copy the output to you favorite editor.
Needed an easier way to script the user info than Enterprise Manager. Found a script by Clint Herring on this site that was close to what I wanted. Modified his script to make the output easier to work with.
Harnessing SQL Server Metadata- Disabling and Rebuilding Indexes
When doing bulk data changes it may be beneficial to disable indexes prior to starting the operation. Fortunately, SQL's rich metadata makes this very easy to automate in a robust fashion.
2018-05-18 (first published: 2015-10-19)
4,851 reads