Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
The Voice of the DBA
 

Daily Coping Tip

Write down three things you appreciate about yourself

I also have a thread at SQLServerCentral dealing with coping mechanisms and resources. Feel free to participate.

For many of you out there working in a new way, I'm including a thought of the day on how to cope in this challenging time from The Action for Happiness Coping Calendar. My items will be on my blog, feel free to share yours.

The Growth of IQP

When Microsoft started to talk about Intelligent Query Processing (IQP) before SQL Server 2017, I wasn't sure what to think. There was a diagram with 20 things on it, and only 5 were highlighted (you can see that in the article linked). That felt like something, but barely something. Over time, as we've gone through SQL Server 2019 and now 2022, the diagram now looks more filled in. In fact, now there are a lot of things filled in.

When I think about new features of SQL Server, I don't often spend a lot of time on the IQP stuff. First, I don't have to live with people yelling at me every day about slow performance. If I did, I might be more anxious to test and evaluate the changes. Second, these are mostly just hidden things that come with the product and (fingers crossed) improve my workload.

There's an article on the 2022 changes, which improve upon some of the older IQP work as well as add some new items. It seems the feedback loops are getting better, though not perfect. I'm sure all the performance tuning experts will write posts about where these things fail, which is good. We want to know where we might have problems. Hopefully, we'll also see lots of demo code that shows where these things work.

One of the more interesting things is the Parameter Sensitive Plan Optimization. This should help with parameter sniffing issues, though it will be interesting to see what percentage of a variable workload is improved by this. I also wonder if loaded systems that struggle here might have other plan issues. I already know some people have an overloaded plan cache now. If they could have even more plans for each type of query, there might be other issues to contend with.

For the most part, SQL Server works well for a wide variety of situations. Many people seem to be quite pleased with how well it performs. I don't know if that means customers look forward to upgrades or are happy where they are, but I am glad that the product doesn't just add developer features or complex technology for administrators to learn. Getting investments in better query performance is important, especially as it can be hard to get developers to write better code on their own.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

 
  Featured Contents
SQLServerCentral Article

How to work with Python in Azure Data Studio

Daniel Calbimonte from SQLServerCentral

Learn how to use Python code with Azure Data Studio to work with SQL Server data.

External Article

Convert Problematic Data in SQL Server

Additional Articles from MSSQLTips.com

In this article, we look at various ways to convert problematic data in SQL Server by using TRY_CAST, TRY_CONVERT, and TRY_PARSE.

External Article

Join the EAP: Next-gen database cloning

Additional Articles from Redgate

Redgate’s database cloning technology is getting an upgrade: Multi-RDBMS, instance-level clones, and support for containerized workflows. Automate DevOps test data for fast quality releases across your software organization. Learn more and gain first access by joining the early access program!

Blog Post

From the SQL Server Central Blogs - Book Review: SQL Server Query Tuning & Optimization

MarlonRibunal from Marlon Ribunal - SQL, Code, Coffee, etc.

If you are like me and still prefer the physical book as your primary reading material, Benjamin Nevarez's book from Packt Publishing is a great book to add to...

Blog Post

From the SQL Server Central Blogs - Putting counters in names

Kenneth.Fisher from SQLStudies

It’s not all that unusual, or unreasonable to put a counter in a name. For example let’s say you need ... Continue reading

 

  Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

Default Raiserror Levels

I am using RAISERROR in my code with various specific error levels that are in sys.messages. I'm lazy, however, and want to just use the default severity level for a message without having to look it up. What can I do with RAISERROR in my code to use the default?

Think you know the answer? Click here, and find out if you are right.

 

 

  Yesterday's Question of the Day (by Steve Jones - SSC Editor)

Idempotent Column Drops

I want to easily ensure that I can run this script idempotently on any of my SQL Server 2019 databases.

ALTER TABLE dbo.Summit2022 DROP COLUMN QuoteByURL

What is the easiest way to make this idempotent?

Answer: Add IF EXISTS after DROP COLUMN and before the column name

Explanation: In SQL Server 2019, and in SQL Server 2016 and 2017, you can use the IF EXISTS clause in the DROP COLUMN statement. Ref: ALTER TABLE - https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-table-transact-sql?view=sql-server-ver16

Discuss this question and answer on the forums

 

 

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


SQL Server 2017 - Administration
Query plans - There is more than 1 plan for a particular query. I suspect it could be auto stats is sampling too low so enabling the persistent sampling. Any thoughts?
SQL Server Profiler - trace data file - Hi all, On the disk noticed some files type SQL Server Profiler - trace data file. It has increasing the file for every 3 hrs. The path location is not matching with the path locations of the traces from the query select * from sys.traces. How can we identify the traces that not showing from […]
SQL Server 2016 - Administration
How to load Extended Events results from memory directly to table, in a script? - Hi all, We created Extended Events sessions that dump results into a file. Then, with a scheduled job we load it into a database table. We want to eliminate the part dumping to a file, and load it directly from buffer ring (which is memory) to a table. We don't use GUI built-in into SSMS, […]
SQL Server 2016 - Development and T-SQL
Left Outer Join Check - Hi Community, Can someone please check my T-SQL code and let me know if I'm getting the right result. I'm doing a left outer join on the following tables and I'm getting 18 records back, but no missing data. This is confusing, because in the circuits table there are 77 records and in the races […]
Development - SQL Server 2014
Error handling with a called stored procedure - Stored procedure OUTER_TEST calls stored procedure INNER_TEST. If an error in INNER_TEST, how do I capture the error message (to store in a table). When I have a try-catch in OUTER_TEST, I can only access a later error message and not the initial one from INNER_TEST?
SQL Server 2019 - Administration
create SPN - how to create  SPN  for  sql  named instance  . SQL service  account is configured  with NT service  account ?
Where are SQL Client Tools located? - Hello experts, I did an installation of just the following tools on a server (that is, no actual SQL Server or Agent etc.) Client Tools Connectivity Client Tools Backwards Compatibility Client Tools SDK Does anyone know where those tools are located on the server? I also installed SSMS but I don't know where the above […]
Patching failover cluster - Hi I'm looking at the process for patching our failover clusters.  I always thought it was best practice to pause the node you were patching to stop unexpected failover. However this Microsoft article seems to say that whilst the setup.exe is running for patching the node is removed from the preferred owners. https://learn.microsoft.com/en-us/sql/sql-server/failover-clusters/windows/upgrade-a-sql-server-failover-cluster-instance?view=sql-server-ver16&viewFallbackFrom=sql-server-2019 To upgrade […]
SQL Server 2019 - Development
Selecting State from table based on a Begin and End Date - Greetings, I have a Report that prompts for a begin and End Date and I need to select a state based on the values entered. I've  The table I am comparing the begin and end dates to looks like this: ID        InitialState     NewState         Date          […]
Getting the rolling weekly average based on the preceding 12 months - Hello, If someone can help me out with the below problem I'm having I would really appreciate it. Thank you! I have one order table and one calendar table; Orders Table: USE [Northwind] GO /****** Object: Table [dbo].[Orders] Script Date: 20/09/2022 22:43:51 ******/SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Orders]( [OrderID] [int] […]
How to export 20 milion rows to only one file ? - I work on sql server 2019 i have table have 20 milion rows . i need to export data Exist on table to only one file by using sql server 2019 . so what best tool and faster tool can help me to extract 20 milions rows from sql server to csv file (only one […]
Conversion of currency stored as varchar to decimal - Hi all, I am trying to convert currency values stored as a string to decimal. In my dataset, there is a currency column with values like $15,000.50 stored as varchar. I am trying to convert it to 15000.50 I tried SELECT CONVERT (decimal , '$15,000.50 ') but end up with the dreaded conversion type error. […]
SQL Server 2008 High Availability
Storage migration validation - Hi All, our storage team is planning to do San migration(from old to new). From application point of view what all steps should I follow to perform complete validity post migration ? We use SQL 2008 DB servers.
Reporting Services
Removing Number from String in SSRS - Hello, New to SSRS 2016 here, and appreciate any help.  Field value coming in with "( " in front of a number, and I was able to remove it using Mid function, but now there are other values where there are values where it is the 2nd "(" that enclose the number.  For example Field […]
Integration Services
Unable to execute SSIS package thru command line - I have SSIS packages which were recently upgraded from 2012 to 2019. I was testing it to see if it would run successfully without any issues. Pretty straightforward package. I have a source and 2 different destination(2 DBs on 2 different DB servers). So when I run the package thru VS, it runs fine. When […]
 

 

RSS FeedTwitter

This email has been sent to newsletter@newslettercollector.com. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -