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

Daily Coping Tip

Find a new way to tell someone you appreciate them

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.

Don't Learn, Do It

I saw a quote in the upcoming dbatools in a Month of Lunches. It was from Jason Krause and said: "Don't try to learn PowerShell. Try to learn to do your current job using PowerShell."

To me, that's good advice for admins, but it's also the advice that I've seen for programmers and developers for most of my career. Don't read about a technology and try to memorize how things work. Actually, go use it to do something.

If you want to learn about SQL, you need to write queries, not just learn the commands. Actually take a problem, like calculating a running total, or aggregating data at certain times, and learn to solve it. If you want to learn how to build a timer, then don't read an article, but actually go build one. You can start with someone else's project, but modify it, practice creating your own, and test your skills.

Many developers know this, and they often end up creating their own projects. GitHub and other online repositories are full of code that they have used to further their own skills. Often when tackling a new issue, developers try to implement a basic version of the same problem to test themselves.

For administrators, especially Windows admins, I see them try to tackle problems with GUIs and wizards far too often. Even admins that know how to script things will fall back on the easy way to accomplish something. I know I've been guilty of that.

Digging into Powershell, or even bash, and using it in your actual work, is a way to start improving your skills and preparing for the future. A future where we will likely need to manage systems in code, store that, and prove that we've deployed systems that meet our requirements and specifications.

There will still be jobs if you can't manage systems with code, but there will be fewer of them. More employees will be picking the staff that do understand how to use code to manage Operations.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

Leading-Edge NoSQL Drivers for NoSQL Analytics and Integration

JerodJ from SQLServerCentral

NoSQL databases, such as MongoDB, are an increasingly important component of enterprise data strategy, handling high-volume, scalable, and agile data management. As organizations adopt emerging NoSQL solutions, there is high demand to integrate these data sources with existing infrastructure and familiar tools. Standards-based data access facilitates your expansion into MongoDB by leveraging existing skills using […]

SQLServerCentral Article

Creating Markdown Formatted Text for Results from T-SQL

tomaz.kastrun from SQLServerCentral

Markdown documents are becoming increasingly more popular and relevant with the emergence of notebooks. Markdown is a markup language for creating formatted text. It is widely used in tools for collaboration, tools for creating documentation and notebooks. Formatting is easy to understand, readable, simple to adopt, and agnostic. I can use a markdown document on […]

External Article

Monitoring Your Hybrid Environment with Redgate

Additional Articles from Redgate

Join this Microsoft hosted webinar to hear from Microsoft MVP and Redgate Advocate, Grant Fritchey to learn more about monitoring hybrid database environments, as part of their Azure Series.

External Article

What is Power Query?

Additional Articles from MSSQLTips.com

In this tip we'll introduce you to Power Query, the self-service data preparation tool from the Power BI family

Blog Post

From the SQL Server Central Blogs - Log Analytics with Dedicated SQL Pools (Formerly SQL DW)

Bradley Schacht from Bradley Schacht

There are a lot of services in Azure. Way more than a few. What is something you want to do with all your services and applications? You want to...

Blog Post

From the SQL Server Central Blogs - Measuring SQL Server File Latency

aen from Anthony Nocentino Blog

This post is a reference post for retrieving IO statistics for data and log files in SQL Server. We’ll look at where we can find IO statistics in SQL...

 

 Question of the Day

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

 

A Funny Substring NULL

I have this code:
CREATE TABLE MyTable
(
    txt NVARCHAR(10)
);
GO
INSERT MyTable (txt)
VALUES ('a'),(NULL);
GO
SELECT SUBSTRING(txt, 1, 2)
FROM MyTable;
GO
This returns two values, an "a" and a NULL. What happens with this code:
SELECT SUBSTRING(NULL, 1, 2), 'NULL'
GO

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 Dynamic Data Masking Email Function

If I add the email function to a column like this:

ALTER COLUMN Email ADD MASKED WITH (FUNCTION = 'email()')

If I have an email of "adam.smith@capitalism.org", what is returned by the masking function for users that do not have the UNMASK permission?

Answer: aXXX@XXXX.com

Explanation: The email() function in dynamic data masking will mask out emails with the first letter of the email and then XXX@XXXX.com, regardless of the string structure. Ref:  Dynamic Data Masking - https://docs.microsoft.com/en-us/sql/relational-databases/security/dynamic-data-masking?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 Vulnerability Assessment for Ransomware review - Hello experts, Does anyone have advice on which, if any, results from the SQL Server Vulnerability Assessment can be used to identify and remediate ransomware risk? https://docs.microsoft.com/en-us/sql/relational-databases/security/sql-vulnerability-assessment?view=sql-server-ver15 Thanks for any help. -- webrunner
SQL Server 2017 - Development
Truncate vs Delete for Bulk Removal of (some not all ) records - EDIT : the table is not 1gb its 1tb   Hi I have a table with 351,495,000 records (about 1TB in size) . I need to remove a bunch of historical data , approx  219,000,000 records. Which be quicker , a delete based on criteria (int column , biggest value 4 digits) , or […]
SQL Server 2016 - Administration
DR test - failover with potential data loss on live server. - Hi All, So I want to test failover to my DR site.  My current set up is 2 x replica in site A (synchronous), 1 in site B (async).   It's a busy live server.  How would you do this? Options I see: Tell client they risk data loss & put them off. Set site A […]
Cannot create SQL AG Listener - HI i am getting this error when i am creating the listener in my AG Cluster resource of type 'Network Name' in clustered role failed. The error code was '0x52e' ('The user name or password is incorrect.').
Restore Database with RECOVER generates new values for identity columns - Hi, We have restored the production backup to a different machine for testing purposes. We found that one of our tables which has auto-increment column marked as "identity" is having different values when compared to Production for the same set of records in the same table. For example, In Production we have a table T1 […]
SQL Server 2016 - Development and T-SQL
Query removing NULLs when not chosen to - I have a result set below from this query: SELECT [CALL_ID], [DATE], [TIME], [CAMPAIGN], [CALL_TYPE], [DISPOSITION], [HANDLE_TIME] FROM A2WH..CallLogCommon WHERE [DATE] = '2021-11-05' AND [CAMPAIGN] = 'Chareleston IB' AND [CALL_TYPE] NOT LIKE '3rd%' ORDER BY [DATE] If I change my query to this to get rid of the word 'Test' in my Disposition column my […]
How to capture particular text from standard column to populate computed column - In SQL Server 2016, While Creating a table I want to populate a computed column that will get a value of E00... or NULL based on the value of the standard title column. So, If the title column contains text E00.. then only the computed column will have the E00.. value else NULL. As shown […]
Rounding issue after decimal in TSQL - HI All, My query is like below: declare @id numeric(17,2) = '123.456' select @id Output : 123.46 Expected output is : 123.45   Please help me on this query.  
SQL Server 2019 - Administration
vmware logical drive set up - Installing SQL Server using different drives for data, tran logs, tempdb and backups has obvious advantages on physical servers. Is there any PERFORMANCE advantages on vmware. I am pretty sure whole server is on 1 data store.
Just got a new DEV server set up How do I load a subset of my production data? - Hi all, The company I'm working for has finally, after a year of me asking, set up a 2019 Standard Edition DEV SQL server for us  so we don't do development in prod anymore. We have seven databases (Only two are important) with associated procs, tables, views, etc...  that I want to move data from. […]
Linked server failed - HI, Here is my issue:   I have 2 SQL 2019 instances and set up 1 linkded server. It works fine in local (remote to the server), but got the error from my workstation: Msg 18456, Level 14, State 1, Line 28 Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. Domain administrator already setup delegation and […]
Maintenance Plan excludes the AlwaysON database - Dear Friends, Want to ask if its normal for the Maintenance Plans to exclude the database(s) in Always On availability Group ? I setup one and saw it works this way...Thanks in advance for ur valuable comments.   Thanks and Best Regards Arshad
SQL Server 2019 - Development
Why is the MS calculation for SQL Server table size not reflect Storage in SSMS - Hi there We have been referring to the following article, in order to work out the size of a table in SQL Server https://docs.microsoft.com/en-us/sql/relational-databases/databases/estimate-the-size-of-a-heap?view=sql-server-ver15 Now summarising the calculation we have the following: Null_Bitmap:                               2 + ((Num_Cols + 7) / 8) Fixed_Data_Size:                       Real (4 Bytes) + DateTime( 6 Bytes) Row […]
SQL Server Newbies
Unable to filter data from the query - Hi, As you know I am a newbie and learning myself how to query the database. I am unable to filter the data from the query below. SELECT DISTINCT a.InvoiceDate AS TransactionDate ,SUM(CASE WHEN a.TrnYear = '2022' AND (a.ProductClass NOT IN ( '_FRT%','CXXX')) THEN a.NetSalesValue ELSE 0 END) AS Dailycheck ,a.ProductClass ,a.SalesOrder,ar.Name FROM TrnDetail AS […]
Reporting Services
SSRS 2019 Prompts for authentication - I have a new SSRS 2019 installation and when users access the site they are prompted to authenticate. Once they do this, everything works fine. However this didn't happen on our SSRS 2016 estate. How can I get this to just open without prompting? I've tried WindowsNTLM and WindowsNegotiate (SPN has been registered) in the […]
 

 

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

 

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