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

Daily Coping Tip

Do something special today and revisit it in your memory tonight

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.

Jumping Air Gaps

There are all sorts of viruses, worms, and malware out in the world, and some of us have had to deal with them at different points in our career. SQL Slammer was particularly memorable for me, but there were plenty of non data related virus issues I've had to work on at various employers.

To keep sensitive information safe, many high security environments have built air-gapped computers, where these systems aren't connected to a network, or at least not a general network in an organisation, and certainly can't access the Internet. At home, you could think of this as an older computer with no network card, or even a spare laptop with a broken network radio. To get information to/from this computer, you'd use some sort of removable media.

Apparently there are concerns about malware being able to jump this air gap, using the removable media. Nothing terribly new here, as infected USB sticks have been a concern for years, but this appears to be a twist and apparently the malware waits for a chance to send information off to a receiver.

If your system is truly air gapped, then there might not be a way for this information to be ever be copied, but what if that isn't the goal. Imagine ransomware uses this technique and infects database backups. If you have an offline place for backups, could a copy of a new backup infect other backups? With separate tapes this isn't an issue, but if you use some sort of part-time connection to move data, this could be an issue.

I'm always wary of online backups or even live copies of data. I know many large systems find tape unusable and impractical, but I know that having physical copies of tapes ensured some level of security for my backups.

The creativity of malicious actors and the threat vectors they devise are scary and incredibly hard to guard against. I don't know what the best solution is for data and database backups, but I certainly hope that someone smarter than me is working on the problem.

Steve Jones - SSC Editor

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

 
 Featured Contents

Monitoring - Level 6 of the Stairway to SQL Server on Linux

Danilo Dominici from SQLServerCentral

In this level of the Stairway to Linux, learn how to use the TIG stack to monitor your SQL Server instance on Linux.

How Many Databases Can You Name?

Additional Articles from SQLServerCentral

How many different database applications exist? Many people can name the most common ones such as MySQL, Microsoft SQL Server, and Oracle. Most good DBAs and programmers could likely rattle off a dozen different databases is you asked them to.

Free eBook: SQL Server Execution Plans, Third Edition

Press Release from Redgate

If a query is performing poorly, and you can't understand why, then that query's execution plan will tell you not only what data set is coming back, but also what SQL Server did, and in what order, to get that data. It will reveal how the data was retrieved, and from which tables and indexes, what types of joins were used, at what point filtering, sorting and aggregation occurred, and a whole lot more. These details will often highlight the likely source of any problem.

From the SQL Server Central Blogs - Formatting Code in ADS with SQL Prompt

Steve Jones - SSC Editor from The Voice of the DBA

One of the most popular and widely used features of SQL Prompt is formatting code. The SQL Prompt extension is in public preview and you can get it here....

From the SQL Server Central Blogs - SSMS Quick Tip: Never lose your script from overwrite again!

Daniel Janik from Confessions of a Microsoft Addict

Twenty something years ago when I started my SQL Server career there was an amazing tool called Query Analyzer. Honestly I’d say if Microsoft did nothing more than bring...

 

 Question of the Day

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

 

A chart of costs in R

I have this dataframe in R:
> head(sales)
        Date Day    Month Year Customer_Age      Age_Group Customer_Gender
1 2013-11-26  26 November 2013           19    Youth (<25)               M
2 2015-11-26  26 November 2015           19    Youth (<25)               M
3 2014-03-23  23    March 2014           49 Adults (35-64)               M
4 2016-03-23  23    March 2016           49 Adults (35-64)               M
5 2014-05-15  15      May 2014           47 Adults (35-64)               F
6 2016-05-15  15      May 2016           47 Adults (35-64)               F
I am looking to get this histogram of unit costs: Hiistorgram of unit costs What should I run to get this?

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 First Sequence

I create this new sequence object:

CREATE SEQUENCE dbo.IncrementByOne AS INT INCREMENT BY 1;

What value do I get from this code?

SELECT NEXT VALUE FOR dbo.IncrementByOne

Answer: -2147483648

Explanation: The default value for a new sequence object is the minimal value for the data type. For an int, this is -2147483648. Ref: CREATE SEQUENCE - https://docs.microsoft.com/en-us/sql/t-sql/statements/create-sequence-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
Old, unnecessary SQL Server windows updates keep failing - any ideas? - Background My organization tightly controls what’s on our internal windows update server. The version of SQL Server that I have installed is Microsoft SQL Server 2017 (RTM-CU20) (KB4541283) - 14.0.3294.2 (X64)   Mar 13 2020 14:53:45   Copyright (C) 2017 Microsoft Corporation  Developer Edition (64-bit) on Windows 10 Enterprise 10.0 (Build 17134: ) (Hypervisor) For some […]
One of six 2017 instances offline - Always On. - Did patch Tuesday yesterday across 6 UCS blades. Servers are 2019 datacenter in a cluster. Each blade has 4 instances so 4 availability groups of 6 members each. One of the 2017 instances is in a bad state. I've tried a repair, I've tried removing updates (even though the other 5 prod blades are fine, […]
SQL 2017 AGL - only accessible locally - Hi, I've got 2 x SQL 2017 CU20 (Dev edition) boxes in a Windows cluster with an AG and listener (non readable sync secondary). The DBs are synchronised and the AGL is contactable through SSMS on the primary server when I'm RDPd on. The SPN is set up for the AGL name with the SQL […]
SQL Server 2017 - Development
Bulk Insert & link relationship between inserted row - Hi, Let me elaborate with example:- I having an existing TableA with below sample column & data Date                             Amount                 Category               Name 2018-01-01                […]
SQL Server 2016 - Development and T-SQL
CTE left join not giving me correct result - Hello, Why is the Left Join with a CTE giving me wrong results? I want to know which Emails are not in Table B using their UserIDs Instead it's giving me all the records from CTE and Null values from the Table B. What am I doing wrong? Many thanks. ; With CTE as ( […]
Encryption table and saving in 2016 - Hi, How would you encrypt data from multiple tables and save in a temp tables using a script (tsql)? please share general logic in sql 2016 version. Should we use always on encryption? or something else and then also how do you decrypt the data from the same temp table and save those in the […]
SQL Server 2019 - Administration
Queries run by a particular login or Database user in SQL Server 2016 - Hello, Is there a way in SQL Server to find out which queries were run by particular login in SQL Server and on which databases? If somebody can provide a script, that will be great. Thanks in advance
Trouble installing latest version of SSMS - Last night I went to the control panel and removed any programs that had 'SQL' in its name.  That was the 2017 version of SSMS.  I wanted to start fresh.  I downloaded SSMS 18.  I'm not sure of the server name, so I tried to find it here: https://docs.microsoft.com/en-us/sql/ssms/tutorials/ssms-tricks?view=sql-server-ver15#find-the-error-log-location-if-you-cant-connect-to-sql-server under the section titled "Find the […]
SQL Server 2019 - Development
Function issue with union (two databases) - I want this function to  retrieve the latest buyer from two databases db1 and db2. It worked for a single db.    Now I try to use UNION to query both dbs an get the latest of the two It won't accept this function "Select statements included within a function cannot return data to a […]
Export sql results to csv -   Hi all, Hopefully you can help me. I have created a sql job which returns some results and then exports it to a csv file. But each column is merged into one cell. The way I have done this is using the sqlcmd feature as per the below: sqlcmd -i Is there […]
How to use stored procedure result set into a script task in SSIS - Hello, guys! I created a SSIS package in Visual Studio Community 2019: Everything is working fine, but I don't know how to pass the data from "Commutations" (SQL Task) to "Net Present Value" (Script Task). Basically, "Commutations" generates a result set that I'm passing to a SSIS object variable. This result set has a couple […]
Pivot Table Problem - I am having a huge brain fart on how to accomplish what I want. I want to pivot the attached set of data (sql file) to look like this (I know its an image but I am not savy enough to plop an actual result set in here). The attached file creates a temp file […]
Integration Services
Execute Powershell Script from Script Task - Has anyone managed to execute a PoSh script from within a Script Task? When I started looking at this, it seemed like it would be straightforward enough and the process is described here. But ... the DLL which that article refers to (and which appears to be necessary to execute PoSh from C#) is called […]
COVID-19 Pandemic
Daily Coping 21 May 2020 - Today’s tip is to reflect on what makes you feel really valued and appreciated. My thoughts: http://voiceofthedba.com/2020/05/22/daily-coping-22-may-2020/
Daily Coping 20 May 2020 - Today’s tip is: Hand-write a note to someone you love and send them a photo of it. http://voiceofthedba.com/2020/05/20/daily-coping-20-may-2020/
 

 

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

 

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