The Lesser Used Functions Recently, I reviewed and article that examined the bitwise functions that were added to T-SQL in SQL Server 2022. As I was looking over the article, I started to wonder if anyone was using these in production code. I used to do bitwise work early in my programming career, when memory and space were tight. However, it always felt like I was hiding some information that a subsequent developer (or my future self), might easily miss. I looked through some other changes to the T-SQL language in the last few versions and made a list. This week I wonder if any of you use these functions in production code? CHOOSE IIF GET_BIT SET_BIT BIT_COUNT DATE_BUCKET APPROX_PERCENTILE_CONT APPROX_PERCENTILE_DISC LEFT_SHIFT RIGHT_SHIFT BIT_COUNT GET_BIT SET_BIT TRANSLATE There are some interesting changes in here, and I can see the use for these functions, but I suspect these are specialized functions built for specific situations (or customers). I don't expect many people to use them outside of those situations, but maybe I'm wrong. Perhaps some of you like doing bitwise operations, you like the logical CHOOSE/IIF, or maybe you can stomach approximate calculations. I'm glad that the T-SQL language continues to grow. I would like to see more changes that ease the development of database code, though I would like Microsoft to ensure these new functions perform well. Some of the changes added in the past haven't done so, especially when a dotNet function is wrapped with T-SQL. Performance matters and many of these functions will be called in queries that need to compete a result with thousands of rows. Let us know today if you've found these functions useful in your work, or if there are changes made in the past that you would like to see improved. Steve Jones - SSC Editor Join the debate, and respond to today's editorial on the forums | The Voice of the DBA Podcast Listen to the MP3 Audio podcast or subscribe to the feed at iTunes and Libsyn. The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. |
|
Noman072 from SQLServerCentral Learn how to resolve access denied errors when attaching databases in SQL Server. This guide explores file permission settings, focusing on the differences between Windows and SQL logins, and provides a step-by-step solution to prevent common attachment issues. |
|
Additional Articles from SimpleTalk Recently, my skills were put to the test when I needed to compare hundreds of Active Directory and SharePoint Groups to find similarities in their memberships. |
|
K. Brian Kelley from Databases – Infrastructure – Security I picked up Never Split the Difference: Negotiating As If Your Life Depended On It by Chris Voss, a former FBI negotiator. Given what I do, I realized that... |
|
Steve Jones - SSC Editor from The Voice of the DBA As we close out the year, I decided to drop this post here and maybe inspire a few of you to write in 2025. This post looks at some... |
|
Site Owners from SQLServerCentral In The Unicorn Project, we follow Maxine, a senior lead developer and architect, as she is exiled to the Phoenix Project, to the horror of her friends and colleagues, as punishment for contributing to a payroll outage. She tries to survive in what feels like a heartless and uncaring bureaucracy and to work within a system where no one can get anything done without endless committees, paperwork, and approvals. |
|
Today's question (by Steve Jones - SSC Editor): |
| SQL in an Azure VM Backup |
If I use the Azure Backup service for automated backups of my SQL Servers in Azure VMs, how often can I configure log backups? (as of Dec 2024) |
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) |
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 |
Proc cache slowly decreasing in size until restart is required - In SQL 2017 (14.0.3475.1) the size of the proc cache is slowly decreasing. The workload on the instance has the same profile every day and does not change with time. The proc cache size started at a little over 5G and after about 3 weeks is down to below 1G. Just before the previous restart, […] |
Proc cache slowly decreasing in size until restart is required - In SQL 2017 (14.0.3475.1) the size of the proc cache is slowly decreasing. The workload on the instance has the same profile every day and does not change with time. The proc cache size started at a little over 5G and after about 3 weeks is down to below 1G. Just before the previous restart, […] |
SQL Server 2019 - Administration |
EXTENDED EVENTS Track What's Logging In - Simple one looking for a script that can track what's logging in from where for UPGRADE discovery. |
SQL Server 2019 - Development |
Using ROW_NUMBER() to increment every time a value occurs - Hello folks, I have some rather unstructured data coming into a staging column from a file. I can guarantee the order of the data on load using a column I am calling RowNumber. I like to group the data using ROW_NUMBER() every time the value 'CreateDate' occurs. Here is current my effort. Thanks if you […] |
how to keep report from running automatically when my params all default to null - Hi I'm standing up a report with 9 visible cascading params , none of which needs to be entered. all will default to null, If i remember correctly , once i set it up, the report will run automatically without the user hitting the run button because all params default that way. how can i […] |
SQL Azure - Administration |
Issue with Creating Linked Server from Azure SQL Managed Instance to On-Premises - Hi, Interestingly, I was able to create a linked server in the reverse direction—from the on-premises SQL Server to my Azure SQL MI—using a remote login and password for authentication. However, when I attempt to establish the link from Azure SQL MI to the on-premises SQL Server, it consistently fails. Additional Details: I have an […] |
General |
When trying to use a LocalDB, I get an error - I tried to find an appropriate forum to post the question. This one seems to be the closest. I'm sorry if I'm wrong. This is a long story, which I haven't time to go into now. I'm starting a new Blazor Web app using .NET 9 and include what's called Individual Accounts (or Individual Users, […] |
Powershell |
display bytea image - I moved a table from MsSql to Postgresql that had a field defined as Image in Mssql now in Postgres it's a Bytea field. How can I make sure data copied across with success? Is there some code I could run to make sure Image looks correct from PostgreSQL ? Thanks. |
Analysis Services |
MDX SSAS Calculated measure for last totals + turnovers - I have a measure with totals for specific dates with the LastNonEmpty aggregation, and a measure with turnovers with the Sum aggregation. Help create a measure with totals for each day that would take into account the last known totals + turnovers from the date of the last totals to the current date. I tried […] |
Integration Services |
PowerQuery.... don't meet SSIS - I have a powerQuery that reads and transforms a table in a PDF. Works a champ. If I wanted to write the resulting table's data to SQL Server, I can use DAX Studio (kind of) because it creates a newtable and writes the data to it. But I wanted to just map the columns to […] |
SSIS package 'Unexpected Termination' status when running from SSISDB catalog - We are trying to run SSIS package to read Access Database (.mdb) files using Native OLE DB\Microsoft Office 12 Access Database Engine OLE DB Provider in the Source Connection Manager. This package ran successfully from Visual Studio 2019 and also from SSISDB catalog in lower end servers. However, executing the package in higher environments resulted in 'Unexpected […] |
T-SQL |
Count of Total Appointments within 30 days of each Appointment Date - Good Afternoon. I have a Table where each Record: 1) Represents an Appointment. 2) Has a field Appointment Date. What I am trying to achieve is this: For each Appointment date in the dataset I wish to count up all the Appointments which occur within 30 days. For example, for 1st July 2024, I wish […] |
SQL Server 2022 - Administration |
I need help accessing my local SQLExpress - My PC has been causing me problems for months. I've told my desktop support team. They reimaged my machine, but it hasn't helped. I cannot run SSMS against the LocalDB I get this error: and that's as far as that goes. If I try to connect to LocalDB I get this error: and that ends […] |
SQL Monitoring tools - our client wants to implement Third Party SQL Monitoring tool to monitor SQL server Performance. I would like to understand any recommendation that is being implemented to monitor the performance. |
Reporting Services in Managed Instance - Hi , one of my on-premises servers one server is having databases and one more server maintain the reporting services . above 2 servers having connectivity between them . we are planning migrate into Azure Managed Instance .do we need 2 managed instance single managed instance . If Single Managed Instance how can we add […] |
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 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -