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

Daily Coping Tip

Contact someone you can’t be with to see how they are doing

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.

Practice Your Skills with the Advent of Code

It's that time of year, when the Advent of Code goes live. It started this week, with a few exercises released last week. You can still join in, and even go back and look at previous years (2019, 2018, 2017, 2016) and go through them. It's a good exercise for your mind.

To be fair, I've never completed the challenge in any year. Usually life gets in the way, and I get distracted. I've gotten through 15-20 in some years, but often the time required to work through the complex algorithms gets me a little discouraged. I'm not a 10x programmer, but I try.

One thing I've done most years is to try and work through the problems in multiple languages. Typically my choices have been to try and solve each item three times, using T-SQL, Python, and PowerShell. I find it interesting to compare the languages and see how to handle the test data and also get the solution to work in each environment.

If you want to stretch your programming mind and have some fun, give the challenge a try. Posting your solutions to a blog or even open a GitHub repo (or other VCS platform). It's a good way to showcase your knowledge, at whatever level it is. You might even learn something if others comment on your solutions.

Steve Jones - SSC Editor

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

 
 Featured Contents

Boost the performance of your SQL Server tables with a TURBO button

Steve Rezhener from SQLServerCentral

Introduction Performance, performance, performance. While performance in SQL Server can be achieved with code improvement and proper infrastructure maintenance, both tasks require an effort. Code reviews and deep index analysis would take time, but sometimes the obvious is right in front of you. Let's talk about HEAP tables, aka tables with no clustered indexes that […]

Azure SQL Database TDE Customer Managed Keys

Additional Articles from MSSQLTips.com

In this tip we will go through the steps for setting up customer managed keys or Bring your own key (BYOK) to be used for transparent data encryption for an Azure SQL Database.

Join us for this year’s final Redgate Summit

Additional Articles from Redgate

With 2020 coming to a close, it's time to look at the new year ahead. Join our final 2020 summit this December 10th, to discover how to implement a generative culture for successful IT teams and how database DevOps will drive growth and ROI in a remote world. Register to tune in live or watch the recordings.

From the SQL Server Central Blogs - Captioning Options for Your Online Conference

Meagan Longoria from Data Savvy

Many conferences have moved online this year due to the pandemic, and many attendees are expecting captions on videos (both live and recorded) to help them understand the content....

From the SQL Server Central Blogs - Power BI – Hungry Median

Joyful Craftsmen from Joyful Craftsmen Blog

Introduction Median is a useful statistical function, which first time appeared in SSAS 2016 and in Power BI around that year as well. There are several articles on how...

 

 Question of the Day

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

 

The JSON Basic Query

I have this document:
DECLARE @json NVARCHAR(1000)
    = N'
 {  "player": {
             "name" : "Sarah",
             "position" : "setter"
            },
   "team":"varsity" 
 }
';
If I want to get the name of the player, what query is used?

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)

The default ORDER BY

If I have an ORDER BY in a SELECT, what is the default ordering?

Answer: ASC

Explanation: The default is ASC. Ref: Order by - https://docs.microsoft.com/en-us/sql/t-sql/queries/select-order-by-clause-transact-sql?view=sql-server-ver15

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
SQL Server Performance Counters - Here's a question that feels like I'm asking if a tree falls in the woods and nobody is there to see it, does it make a noise? With that - Performance Counters (SQL Server specific ones), do these run in the background the entire time? Or does starting up Perfmon and tracking them start them […]
SQL Server Mirroring - Principal cannot set endpoint to Mirror - I followed the below guide & I am stuck on the very last step where you set the endpoint to reference the mirror server.  The result is the same even if I use SSMS. I am able to telnet successfully on port 5022 from principal to mirror. I am also able to telnet successfully on […]
SQL Server 2016 - Administration
is_merge_published - I'm running the following query to get a list of my Merge Publications but I'm getting results of publications I have deleted a long time ago. Thanks in advance, David. SELECT name as merge_published_db FROM sys.databases WHERE is_merge_published = 1 ORDER BY merge_published_db
SQL Server 2016 - Development and T-SQL
How to aggregate Dimension values properly - Ahoi, im trying to deal with a user request to combine 2 values of a column based on values of a different attribut. I managed to make it work like this, creating 2 hidden memembers and combining those in my cube script. --Hidden 1 CREATE MEMBER CURRENTCUBE.[Order].[Ordertype].[Onlineshop Webshop] AS ([Order].[Ordertype].[All],[Order].[Belegart MDX Ohne Mandant].&[Webshop]), VISIBLE = […]
SQL 2012 - General
questions about sys.sysprocesses/sys.dm_exec_sessions and sys.dm_exec_requests - I have some questions   about sys.sysprocesses/sys.dm_exec_sessions and sys.dm_exec_requests, please kindly give your guidance and comments, thanks! 1. under Microsoft SQL server Management Studio, when I execute select * from sys.dm_exec_sessions and select * from sys.sysprocesses, they have same pieces of records, so spid of sys.sysprocesses is the same thing with the session_id of sys.dm_exec_sessions, is […]
SQL Server 2012 - T-SQL
Converting minutes to hh:mm:ss - I'm trying to develop a formula to convert minutes (my raw data) to hh:mm:ss format. E.g.: 526.30 minutes = 31,578 seconds which should read 08 hrs. 47 minutes and 8 seconds or 08:46:08 ~ I think (?)
SQL Server 2019 - Administration
Interpreting Index Usage Stats on an Availability Group - I've been querying sys.dm_db_index_usage_stats on the nodes of an availability group, and I've noticed an exponential difference between the number of user_seeks on the primary node versus either of the secondary nodes. On the table I'm analyzing, the primary node has many indexes with user_seeks greater than 100,000, whereas on the secondary nodes not one […]
Virtual SQL - Standard vs Enterprise, per-core - Hi, I understand that licensing all the Cores in a physical host with Standard Edition and SA give almost the same benefits as Enterprise Edition with SA, but what does the one that isn't included in Standard - Unlimited Virtualization - actually mean? I'm working on a 2-site design that involves SQL versions 2012 through […]
SQL server service account lost permission on directories - I last week installed a SQl 2019 instance on a new server, applied the service pack. Everything looks fine. Then this week when I login to that server again I noticed all the services in the configuration manager are down,  this include database engine, SSIS, and SQL server agent. I tried to restart the services, […]
SQL Server 2019 - Development
Ideas for Auditing - I'm currently looking to design some auditing on my SQL application and am wondering what would be the best way. Basically when a user Inserts or Updates I would like to capture what the previous value was and what the new value is. This would be across about most of  my tables and could be […]
Can I download Shapefiles for all countries from somewhere? - I'm trying to get my head around the Geography/Geometry methods in SQL Server... are the shapefiles for all the countries downloadable from somewhere? So far I haven't found them.
Random Timeout Error - Hi, following a code release we have seen random timeout errors. I'm not sure whats causing the system to slow down to the point that a timeout happens so set a SQL profiler running and found that on 2 traces before the timeout occurs there is a deadlock thing recorded... SET DEADLOCK_PRIORITY -10 Does this […]
Azure Data Factory
Set Variable to lookup first row value with white space in property name - Hi, How can I set the value of a variable from a Lookup activity when thw property name hase a white space? I'm trying to do it this way but fails: "value": "@activity('LookupMaxRecordId').output.firstrow.Record ID#", Find the complete code below: Thanks! ************* { "name": "pipeline8", "properties": { "activities": [ { "name": "LookupMaxRecordId", "type": "Lookup", "dependsOn": [], "policy": { "timeout": "7.00:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": false, "secureInput": false […]
General
poor performance function - Hello friends. This is my table "Cuentas" [IdCuenta] [int] IDENTITY(1,1) NOT NULL, [IdJerarquia] [int] NOT NULL, [Cuenta] [varchar](20) NOT NULL and I use this function CREATE FUNCTION [dbo].[fIdCuentaPadre] (@IdCuenta as integer) RETURNS integer AS BEGIN DECLARE @IdJerarquia INT DECLARE @Cuenta VARCHAR(20) SELECT @IdJerarquia = idjerarquia, @Cuenta=Cuenta FROM cuentas WHERE idCuenta = @idCuenta RETURN (SELECT TOP(1) […]
Integration Services
SSIS Startup directory not found - This seems to be a common issue throughout my packages. Anywhere I try to access anything in the startup directory. The startup directory is a server URL mapped to Z:\. In this example package. The task that is failing is a script task that verifies the components required are in the startup directory.  This is […]
 

 

RSS FeedTwitter

This email has been sent to {email}. 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

 

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