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!
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
SOURCE CODE ATTRIBUTION: Before I proceed, I want to give credit to the original procedure by sfrejofsky based on which I created this procedure (mostly improvements). The source of this procedure is https://stackoverflow.com/questions/10404348/sql-server-dynamic-pivot-query I had a need to do dynamic PIVOTing for one of my projects and instead of reinventing the wheel, I used the … Continue reading SQL Server – Dynamically PIVOT ANY Column On ANY Table in ANY Database For ANY Aggregation With ANY Condition
Thanks to everyone who attended my "Instrument your code - Basic TSQL Logging" presentation. The material accompanying the presentation is available for download here: https://onedrive.live.com/?id=74472AED60B210DA%211183&cid=74472AED60B210DA The source code is open-source and the community is encouraged to enhance and update. The Github home for it is https://github.com/SQLJana/TSQL_Logger Feel free to experiment with the code and post feedback/comments and file … Continue reading “Instrument your code – Basic TSQL Logging” presentation
Permissions are complex! Permissions management is not easy. You have a lot to deal with Direct user privileges via grants Privileges to AD Group login of which user is part of User could be part of multiple AD groups which have a login on the instance Privileges granted to the role that user is in … Continue reading SQL Server – Find Effective Permissions of An User At Database, Server or Object Level – The Right Way!