If you have been working with PowerShell and SQL Server for a while now, you know that it is not difficult to capture the PRINT statement output as VERBOSE output (which can then be redirected to a variable or file). You also know that it is not too difficult to run SQL in parallel against … Continue reading PowerShell & SQL Server: Run In Parallel – Collect SQL Results With PRINT Output From Across Your SQL Farm – Fast!
Everyday is an interesting day in the life of a DBA. Today, I received a request to run in a HUGE script. This script had 125k INSERT statements each in a separate line. Just opening the script was an issue, leave alone running it into a database. You get this error in SSMS just trying … Continue reading SQL Server: Run A Very Large Script By Splitting It Into Pieces Using PowerShell
Backups are a very important part of a DBA's job. Understanding when they have happened and when they have not happened is even more important. Quantifying things quickly can mean the difference between good and bad decisions when you are in a bind. Note: If you are looking to do something similar with Oracle, please … Continue reading SQL Server: Visualize Your Backups For Insights – By Month Day, Time etc.
Today, a need came-up where a bunch of stored procedures had to be altered based on certain criteria. Easy way: Obviously, the easiest way would be to script out the stored procedures to a file/editor and do Find/Replace with the UI dialog. However, this does not work if there are lots of stored procedures and … Continue reading PowerShell: Find & Replace SQL Server Stored Procedure Code En Masse Based On Custom Criteria
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”