Category Archives: Powershell

Powershell DataTable Select Distinct or Unique Values

Working with data in a DataTable means understanding how to find, sort and select what you need. Since this blog is about database we are basically looking at selecting data similar to the T-SQL command. The Select distinct statement returns only 1 for each unique record. This includes combinations so… Read more »

Use Powershell To Get SQL Database Versions Locally or Remote

Collecting version information for your environment is a never ending task but Powershell can be used to make things easier. Each SQL server instance can be different and a single server can have multiple SQL instances with different versions. In SQL server we can use SSMS to run the following… Read more »

Use Powershell To Backup SQL Database Remote

      No Comments on Use Powershell To Backup SQL Database Remote

This is a Powershell script I’ve used for a few years that creates a dated folder and places a backup for a single database in it. This version uses the “Invoke-Sqlcmd” and you may need to install the module before using this script. Install-Module sqlserverGet-Command -ModuleName sqlserver You only need… Read more »