SQL Server Backup Monitoring with PowerShell
In this part of the series we look at how to use the PowerShell monitoring scripts to collect backup information from your monitored instances.
2020-07-24
In this part of the series we look at how to use the PowerShell monitoring scripts to collect backup information from your monitored instances.
2020-07-24
Being able to get information and save it on a Excel as a report can be a common and tedious task. What if we could join dbatools and ImportExcel PorwerShell modules to accomplish this in a easier and fast way? We will see how to export roles and its' member and save that info on a multi spreadsheet Excel file with handy tables ready to be explored.
2020-06-30
6,500 reads
I have created this script for one of our client, the requirement was all the databases should be in full recovery model and should be monitored. Also, I added other important parameters like AutoShrink, AutoClose etc. Output:
2020-06-16
1,102 reads
This script can install Service pack, security patch and Cumulative update on SQL instance(Database Engine).
2020-05-26 (first published: 2020-05-19)
1,712 reads
Scripts contains 4 following functions. Users can create 3 different script from this for inserting, fetching and deleting a document.
1. Function Generate-MasterKeyAuthorizationSignature - This function is used to create connection to Azure cosmos DB. This function codes were taken from Technet.
2. Function Post-CosmosDb - Insert single document in azure cosmos DB. Same function can be used to perform bulkinsert. This function code was taken from following article. To make it useful i made some modification in it.
(https://www.systemcenterautomation.com/2018/06/cosmos-db-rest-api-powershell/)
3. Function Get-CosmosDocument - Fetch single document from azure cosmos DB. Same function can be used to fetch all documents from Cosmos DB.
4. Function Delete-CosmosDbDocument - Delete single document from cosmos DB. Same function can be used to delete more than one document with some additional codes.
To use any of the function like Post,Get, Delete. you have to comment the other 2 function call. If you are using all 3 functions(Post,Get, Delete), Be cautious while using them.
2020-05-11 (first published: 2020-04-30)
3,667 reads
A common question that I've seen online is how do I return multiple sql datasets from a single query using INVOKE-SQLCMD. Most of the answers out there say it is not possible, but it is in fact possible by using the OutputAs dataset parameter. This parameter outputs a dataset that has all of the information […]
2020-04-24 (first published: 2020-04-16)
6,829 reads
Phil Factor shows uses SQL Clone and PowerShell to automatically create images of all databases on an instance, if they don't already exist, and then create or refresh clones of each one, on all your development servers.
2020-01-30
Comments are helpful when programming in any language, and PowerShell is no exception. In this article, Greg Moore demonstrates how to use comments to document code and to add prerequisites in PowerShell with #Requires.
2020-01-23
This is a simple powershell script to query and display hardware and OS information from a remote computer.
It uses CIM (Common Information Model) that is available since Powershell version 3 so as long as you have version 3 and up, you should be able to run this script against any server that you have access to.
2019-08-14 (first published: 2019-08-06)
2,279 reads
Learn how you can automate the creation of the CML and CEK for Always Encrypted in SQL Server
2019-06-10
8,242 reads
By Chris Yates
I am excited to cover the Microsoft Keynote on Day 2: Redgate Keynote: Simplifying...
By Chris Yates
I’m thrilled to be covering the Microsoft Keynote: Fuel AI Innovation with Azure Databases on Day...
By James Serra
Many customers ask me about the advantages of moving from Azure Synapse Analytics to...
Hi, In my Always On Availability environment, I am seeing two encrypt_option values as...
Hi everyone I have a bunch of CSV files that I need to bulk...
Comments posted to this topic are about the item What's New for the Microsoft...
I have this data in a SQL Server 2019 database:
Customer table CustomerID CustomerName 1 Steve 2 Andy 3 Brian 4 Allen 5 Devin 6 Sally OrderHeader table OrderID CustomerID OrderDate 1 1 2024-02-01 2 1 2024-03-01 3 3 2024-04-01 4 4 2024-05-01 6 4 2024-05-01 7 3 2024-06-07 8 2 2024-04-07I want a list of all customers and their order counts for a period of time, including zero orders. If I run this query, how many rows are returned?
SELECT c.CustomerName, COUNT(oh.OrderID) FROM dbo.Customer AS c LEFT JOIN dbo.OrderHeader AS oh ON oh.CustomerID = c.CustomerID WHERE oh.Orderdate > '2024/04/01' GROUP BY c.CustomerNameSee possible answers