What are Schemas for? All of you are familiar with the default and built-in schema "dbo". When you create an object without a schema, "dbo" becomes the schema for the object. Generally, it is NOT considered a good practice from a manageability or security perspective to have everything owned by "dbo". The alternative is to … Continue reading SQL Server: Time To Switch Schema Of All Objects Away From “dbo”
Month: January 2018
Clone A SQL Server Software Installation
Cloning is perhaps not the right term to use here but let us pretend that it is and keep going. Let us say that you want to install SQL Server on another host say NewHost but you want it to have the same settings as another host/instance on say ModelHost. In fact, let us say … Continue reading Clone A SQL Server Software Installation
PowerShell: Lookup Active Directory Accounts Flexibly/Exhaustively For A List Of First/Middle/Last Names
Before we begin, if you are running Windows 7 or above and if you do not have the PowerShell Active Directory module installed, please do so first by downloading and installing “Remote Server Administration Tools”. I personally cannot live without this module. Please be sure to check out my related blog post which uses the function described … Continue reading PowerShell: Lookup Active Directory Accounts Flexibly/Exhaustively For A List Of First/Middle/Last Names
PowerShell Tip: Specify Select Column List (Attributes/Properties) Dynamically
As we pipe stuff through a pipeline, we may have the need to add/remove/rename columns. These three operations are easy to do. Remove/Add/Rename Remove: Here we remove all attributes returned from Get-Process except Handles and ProcessName by not selecting them Alternatively, you could use the ExcludeProperty parameter if you have to select everything except a … Continue reading PowerShell Tip: Specify Select Column List (Attributes/Properties) Dynamically
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