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

Daily Coping Tip

Send an encouraging note to someone that needs a boost

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.

Post Attack Actions

I have been surprised across the last few years how often I've heard of someone at a company suffering a ransomware attack. Not a highly publicized attack in the media, but a quiet conversation from a friend. There are well publicized ones, but many that never make the news.

Apparently there were nearly 200 mm attacks in Q3. That's incredible, according to a survey. That feels high, but maybe these are multiple attacks against an organization or they are counting each machine affected. It's hard to tell, but that's quite a few.

In any case, if you're attacked, what do you do? I saw an article on steps to take, most of which I would expect any sysadmin to think of. However, I also know you might be stressed or some into a situation where many people are distracting you, so it certainly pays to have a checklist of how to tackle things.

There are some very creative methods of hiding malware inside of operating systems and backups, but I don't know that I've seen anyone attack something like a SQL Server backup. I would certainly make sure that I had these file backups saved in a way that I can recover them without recovering the host OS. I might also think about putting any disk storage backups on a different OS, reducing the chance that you would lose both to an attack.

A ransomware attack is a disaster, and those are always stressful. However, the more you prepare and practice, and think through the possibilities, the greater the likelihood you can recover. Preparation is key here, so if you manage systems, spend some time thinking about being prepared today.

Steve Jones - SSC Editor

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

 
 Featured Contents

The Dilemma of DBAs

poornima.belkale from SQLServerCentral

What does your title mean? Does it match your duties? Do you even care?

Azure Data Factory Pipeline Logging Error Details

Additional Articles from MSSQLTips.com

In this article we will cover how to capture and persist Azure Data Factory pipeline errors to an Azure SQL Database table.

Win a Pluralsight subscription with Redgate’s competition

Additional Articles from Redgate

Redgate is giving you the chance to win a three-month subscription to the technical skills platform Pluralsight and Redgate goodies with their latest competition. To enter, visit the Redgate Forums and answer the question ‘What’s your favorite SQL Monitor feature and why?’

From the SQL Server Central Blogs - Unable to Connect to Target Server? But, I'm Already Connected!

@DBA_ANDY from Nebraska SQL from @DBA_ANDY

I am working on an Azure SQL Database migration from an on-premises VM, and at the client's request I am working through the BACPAC Import/Export process rather than using...

From the SQL Server Central Blogs - Using Data Compare with Recent Data Only

Steve Jones - SSC Editor from The Voice of the DBA

This is a post that looks at how to compare data changes in recent data. A customer recently asked me about looking at a table, and choosing specific data...

 

 Question of the Day

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

 

Finding the last month's values

I have some data in a table, which looks like this:
saleyear salemonth currMonthSales
2020     11        525.00
2020     12        1610.00
2021     1         900.00
I want to get these sales for the month, along with the prev month sales, in each row. I have this query:
SELECT 
       ms.saleyear
     , ms.salemonth
     , ms.currMonthSales
     , xxxxx AS prevsales
FROM   dbo.MonthSales AS ms
ORDER BY ms.saleyear DESC, ms.salemonth desc;
What should replace xxxxx in the query?

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 Limit on Control

What can I not grant to another user if I have the CONTROL permission on a database object?

Answer: Grant ownership to another user

Explanation: The only thing CONTROL limits on database object is granting ownership. Ref:

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
Can't import certificate - Hello, For a SCCM installation, we have been told we need to install a certificate.  I am supposed to install it in configuration manager. I go to the certificate tab.  However, I don't see an import.  I've looked up the internet and see where I should be seeing an import button.  I am an admin […]
Using SQL Configuration Manger 2019 on SQL 2017 instances. - I'm hoping this is a simple (obvious) question... I'm charged with implementing a solution for TLS encrypted connections to 3-node SQL Server  2017 Always-On AG.  I was reading in the documentation that SQL Configuration Manager 2019 greatly simplifies deployment/management of certificates across the AG and that Configuration Manager 2019 can be used on earlier versions. […]
SQL Server 2017 - Development
Convert International Character-String Date Formats - We are receiving some international text file(s) with date(s) (and other fields) in languages other than english (dez, déc, etc). Does anyone know of a method to try and convert dates into a us-english format? Here is what was tried at the moment: DECLARE @Date varchar(20), @Date1 VARCHAR(20), @Date2 VARCHAR(20) SET @Date = '25 déc […]
Stored Proc:Can I use a parameter of comma separated Id\'s within a WHERE clause? - I need to return records that contain one of several primary key Id's (these Id's are INT data types).  The id's will be passed into the stored procedure via a varchar containing the id's separated by commas.  I'd like to then use these Id's within my WHERE clause but I'm not sure how. Ex. DECLARE […]
SQL Server 2016 - Administration
Query plans not getting cached - Just wanted to know what this could be   I have a simple query that takes 1 min for the initial run and then it takes less than 10 secs after the second run in test environment and I can see the query in the cached plans I run the same thing in prod it […]
SQL Server 2016 - Development and T-SQL
Replacing String Between Two HTML Tags - Hi all, I could use some assistance with this one as I can't get anything working correctly for it at the moment. I'm having to move some HTML formatted data between two applications and they have a few differing quirks regarding how they handle HTML formatting. The specific quirk that is causing me issues is […]
Counting Daily Active Accounts per Category - Hello everyone, I am trying to get the number of daily active accounts per given category. I have the following table that contains accounts, their category, and when they moved into that category. ` ID     Category       Category_Date 11       1                        2021-01-05 12      3                       2021-01-05 11       2                       2021-01-18 12      2                       2021-01-19 14      5                      […]
Stored procedure performance issues - I've been tasked with improving the performance of a colleagues stored procedure, and could really do with some advice to ensure that I don't lead them down the wrong path. The stored procedure creates a temp clustered index based on values from a user table-value function output (input for this function is one of the […]
SQL 2012 - General
How to replace OR statment on revision by another best practise and more perform - How to replace OR statement on revision by another best practise and more performance ?   I work on SQL server 2012 I face issue I need to use any thing alternative or best from using OR statement multiple time . so How to use any solution without Using OR statement on Revision with another […]
SQL Server 2019 - Administration
TDE With Log shipping - Our environment is SQL Server 2019. I'm new to TDE and am having to learn it because of a vendor request, but I am having trouble finding a similar environment to ours as I Google. We have a vendor's healthcare application my company uses and the DB supporting the app is in a cloud environment […]
2019 SSRS Install problem - We're upgrading from 2012 to 2019 and I'm running into multiple issues with SSRS 2019. But let me start with the basic one. How do we install the dev version of this as a named instance? It installs as "SSRS" but I want to install it as our old instance name so we don't have […]
SQL Server 2019 - Development
SQL Query - Get Start/End Date per Employment Period - Hi All, Need to get Start and End Date per eployment period, meaning an employee can be hired and rehired. I attached a sample data and desired output.   Thanks
It does not keep the data in the table being filled from a stored procedure - I would like to know why when consulting a table that is filled with a stored procedure and the last one is called with an openrowset, it does not return data. Example CREATE TABLE dbo.Test (Id INT, Nombre VARCHAR(10)) GO CREATE PROCEDURE ProcedureTest1 AS BEGIN INSERT INTO dbo.Test VALUES(1, 'Deblin') SELECT * FROM dbo.Test END […]
Why I have problem with adding IDENTITY in my table? - I want to create Table which name is ARTIKAL. Also I want to set Identity  in ID column but every time when I run my code I get this. Here is the code CREATE TABLE [dbo].[ARTIKAL] ( ID int IDENTITY(1,1) NOT NULL, Naziv char(10) NOT NULL, Cena decimal (5,2) NOT NULL, Kolicina int NOT NULL, […]
Reporting Services
Long running report- kill the session - There are few reports in our environment which run on read only replica, but they take over 3+hrs. We have decided that any report that runs for more than 2 hrs should be killed and rolledback. How do we identify that that report was killed (session was killed) due to this reason? Should I write […]
 

 

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

 

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