PowerShell: Script Out SQL Server Objects DDL To Folder Using dbatools

Today, I am going to show a simple script that uses dbatools to script out SQL Server Database level objects like Tables, Views, Stored Procedures, SQL Agent Jobs, Triggers, Database Users, etc., With dbatools, it is simple enough to also script out Instance level objects like logins, database mail profiles/accounts, credentials, SQL Agent objects, linked … Continue reading PowerShell: Script Out SQL Server Objects DDL To Folder Using dbatools

PowerShell & WPF: Marry Them For Reusable Scripts & Beautiful GUI!

This post is just to give you an idea of what is possible with PowerShell and WPF. It is not a complete solution that is ready to use. I do give you the key functions necessary to make it all work for your scenario and choices you want to make. As an Admin and an … Continue reading PowerShell & WPF: Marry Them For Reusable Scripts & Beautiful GUI!

SQL Server: Run A Script In Command Line Mode (SQLCMD) Inside SQL Server Management Studio (SSMS)

In mature IT shops, all deployment scripts in a release are run into the database using command-line batches as opposed to doing it by hand. Error running SQLCMD scripts in SSMS Occasionally, when one is testing a single script within a release to make sure it works, he/she needs to jump to the command line to … Continue reading SQL Server: Run A Script In Command Line Mode (SQLCMD) Inside SQL Server Management Studio (SSMS)

PowerShell – Running Your App’s Scripts Out Of A HOME Folder (+) Dot-Source All .ps1 Files In Folder Recursively

First, I cannot completely take credit for this post. This is a technique that Andrew (my Team Lead as of this writing) used in his code, which I liked very much and hence am sharing with you with my own thoughts added. The technique that you are about to see works even with UNC paths. KillerApp - … Continue reading PowerShell – Running Your App’s Scripts Out Of A HOME Folder (+) Dot-Source All .ps1 Files In Folder Recursively