One of the more frequent requests that a SQL Server DBA receives is to "Clone a login" with all its permissions. For example a request could be Clone BILL_BLACK's login and create a new login JACK_JOHNSON with exactly the same privileges in all databases. Clone AD group login BILLING_APP_ADMINS and create a login for new … Continue reading PowerShell/dbatools Tip – Clone a login / database user
Tag: Export
PowerShell: Export-QueryToSQLTable – Export All Of Glenn Berry’s DMV’s, sp_WhoIsActive, sp_Blitz & Any Of Your Own Queries To SQL Server Tables
There are native PowerShell cmdlets to export to CSVĀ or text but I have not seen one that can easily export any SQL query output to a SQL Server table in bulk (Write-DbaDataTable function of dbatools does it for one table which I use in my solution below). I probably did not look too hard … Continue reading PowerShell: Export-QueryToSQLTable – Export All Of Glenn Berry’s DMV’s, sp_WhoIsActive, sp_Blitz & Any Of Your Own Queries To SQL Server Tables
SQL Server: Move Database Files To Another Drive/Folder Like A Pro!
Last week, I wrote a post on how to relocate Oracle data files from one drive to another. Today, let us see how simple it is to do the same in SQL Server. I recently had to move 125 databases on an instance to a new and expanded volume mountpoint to allow for growth, which … Continue reading SQL Server: Move Database Files To Another Drive/Folder Like A Pro!