Posted by Barac in Updates
on Sep 25th, 2018 | 0 comments
SQL SERVER 2019 Update Version: MSSQL 2019 RTM CU-16 SECURITY UPDATE, Build: 15.0.4236.7, KB: KB5014353, Release Date: June 2022, Download: https://support.microsoft.com/en-us/topic/kb5014353-description-of-the-security-update-for-sql-server-2019-cu16-june-14-2022-f0afe659-bd19-4c87-a417-a4c67a47e644; Update Version: MSSQL 2019 RTM CU-16, Build: 15.0.4223.1, KB: KB5011644, Release Date: April 2022, Download: https://support.microsoft.com/en-us/topic/kb5011644-cumulative-update-16-for-sql-server-2019-74377be1-4340-4445-93a7-ff843d346896;...
Posted by Barac in SQL Server
on Aug 14th, 2018 | 0 comments
In one of my previous posts, I show you how to use PowerShell to manage your SQL Server database backups and how to install the SQL Server PowerShell module. To be able to manage SQL Server Database Backups you will need to load Microsoft.SqlServer.SmoExtended assembly. If not you can end up with the following error. PS>TerminatingError(New-Object): “Cannot find type [Microsoft.SqlServer.Management.Smo.Backup]: verify that the assembly containing this type is loaded.” new-object : Cannot find type...
Posted by Barac in Powershell, SQL Server
on Aug 8th, 2018 | 7 comments
Some users complained that they cannot use my PowerShell script published on TechNet https://gallery.technet.microsoft.com/Use-PowerShell-to-Backup-3bb0a397 It is a PowerShell script to Backup all user databases to Azure Storage. They experienced the following error: 8/14/2018 11:18 AM – Setting Folders PS>TerminatingError(New-Object): “Cannot find type [Microsoft.SqlServer.Management.Smo.Server]: verify that the assembly containing this type is loaded.” new-object : Cannot find type...
Posted by Barac in SQL Server
on Jul 27th, 2018 | 2 comments
This is an example of missing index query (DMV) of the database within email alert, we already had examples how you can use sp_send_dbmail stored procedure from msdb database to send backup size email daily, long-running queries report and how to send missing indexes (Cached Plans) report via email. This is just another use case of sp_send_dbmail stored procedure. I used following arguments to achieve this @profile_name (name of an existing Database Mail profile, type sysname, default NULL), If you are not sure about your profile account use...
Posted by Barac in Azure, Powershell
on Jul 4th, 2018 | 0 comments
This will be a simple example of how you can delete older containers in the Azure storage account. I will use Azure automation to scan storage containers and delete those matching the certain date pattern. First, you need to choose an existing one or create new automation account to run your Runbooks You should put the script within your Runbooks under the process automation. You will have some useful tutorial Runbooks as well. We will use connection name with information needed to authenticate with...
Posted by Barac in SQL Monitoring, SQL Server
on Jun 24th, 2018 | 0 comments
Recently I had a customer with a really slow query execution and a case of large page splits number on the temporary database. In this example, I tried to replicate the similar issue on my local SQL instance using StackOverflow database. You can download this StackOverflow DB from Brent Ozar web page, just follow the instructions How to Download the Stack Overflow Database via BitTorrent Firstly I created an Extended Event session to follow up if the page splits occur. DBCC DROPCLEANBUFFERS CREATE EVENT SESSION [PageSplits] ON SERVER...
Posted by Barac in SQL Server
on May 30th, 2018 | 0 comments
Recently we had really nice meetup gathering here in Auckland. Was a beautiful evening, there were 20 people talking about SQL server, was perfect. One of the topics was “Merge Join Operator” For this demo I used SQL Server 2014 Developer Edition. As a database I used StackOverflow, you can download this DB from Brent Ozar web page, just follow the instructions How to Download the Stack Overflow Database via BitTorrent In this example I will use two tables Badges (25 million rows) and Users (8 million rows) and I will join them on Userid...
Posted by Barac in SQL Server, SQL Tips and Tricks
on May 4th, 2018 | 1 comment
This is example of long running queries of database within email alert, we already had example how you can use sp_send_dbmail stored procedure from msdb database to send backup size email daily, and how to send missing indexes report via email. This is just another use case of sp_send_dbmail stored procedure. I used following arguments to achieve this @profile_name (name of an existing Database Mail profile, type sysname, default NULL), If you are not sure about your profile account use the following script, it shows all the accounts for all...
Posted by Barac in SQL Server
on Apr 21st, 2018 | 0 comments
Recently we had really nice meetup gathering here in Auckland. Was a beautiful evening, there were 20 people talking about SQL server, was perfect. One of the topics was “Bad estimates and Memory Grant Warning” For this demo I used SQL Server 2014 Developer Edition. As a database I used StackOverflow, you can download this DB from Brent Ozar web page, just follow the instructions How to Download the Stack Overflow Database via BitTorrent In the previous post we talked about using string function in the WHERE clause and bad estimates...
Posted by Barac in SQL Server
on Apr 19th, 2018 | 2 comments
Recently we had really nice meetup gathering here in Auckland NZ. Was a beautiful evening, there were 20 people talking about SQL server, was perfect. One of the topics was “String functions in the where clause and bad estimates” For this demo I used SQL Server 2014 Developer Edition. As a database I used StackOverflow, you can download this DB from Brent Ozar web page, just follow the instructions How to Download the Stack Overflow Database via BitTorrent Using string function in the WHERE clause can cause bad estimates. I...