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 »
The DataTable is an extremely useful Object when working with different sources and types of data in SQL and using Powershell. The DataTable Class is packed with Methods to work with data coming, going relationships and more. Creating a DataTable is a simple as: In this example we are focusing… Read more »
The SSMS application is very versatile and can be easily used to export queries you run into a simple comma separated file (CSV). This is great when your working with only one instance but what if you need to consolidate data from multiple instances in the environment? With this example… Read more »
For most DBA’s we will use SSMS and connect to the SQL instance to see if a databases exists and is spelled correctly. This is usually in response to troubleshooting a connection so connecting to the SQL instance makes sense as you may need to check the login permissions too…. Read more »
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 »
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 »