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

Daily Coping Tip

Looking back at the pandemic, what are the strangest memories you have?

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.

Backup Architecture

I saw a question posted recently on what data is included in a full SQL Server database backup. I hadn't seen that question in some time, but the post was a good reminder that this is not an intuitive concept, and new data professionals might not understand how a full backup works. If you don't know, you should do a little research (and write a #SQLNewBlogger post for yourself).

The way a SQL Server backup works, either with an on-premises install or the Azure SQL Database version, is well known and documented. Even if you can't make a "normal full backup" in Azure SQL Database, the process is the same. You don't have to run the backup, as Azure does that for you, but you can specify a restore and understand which data will be available in your restored database.

Cosmos DB is a different type of data store, existing only in Azure and storing non-relational data. The service has been promoted quite a bit, and some of you might even be using it. Do you understand how backups, and more importantly, how restores work?

I ran across an article that discusses the way Cosmos DB continuous backup works. This process isn't quite what I'd expect. Changes are backed up locally (either LRS or ZRS), which makes sense. However, all changes (called mutations for some reason) are backed up within 100s, asynchronously. That's good, and it's not perfect, but it's pretty good. What's more, you can restore a container, a database, or the entire account. That matches up closely with what I expect in Azure SQL, including the need to restore into a new account. What isn't great is that stored procedures, triggers, and UDFs aren't restored.

As with any sort of backup and restore operation, you should be sure you understand the way operations occur, the impact of restores, and the costs involved. You get charged for backup space and restores. Maybe the most important thing to know is how to perform a restore. If you have a problem, you want to be sure that you not only know the mechanics of restoring data but how to reconcile any potential changes between the old and new database, as well as how to ensure all other objects (stored procs, etc.) are put back in place and clients are directed to the correct database.

This process might not be as simple as MS Docs describes, and certainly, I've found SQL Server restores are not always as simple as we might like. Practice ahead of time and be sure you can recover a system in a way that meets your clients' needs.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

How to Compare Tables in Azure Data Studio

Daniel Calbimonte from SQLServerCentral

Learn about the Schema Compare feature in Azure Data Studio.

External Article

Build SQL Server CLR Triggers

Additional Articles from MSSQLTips.com

In this article we look at how to create SQL Server triggers using Common Runtime Language (CLR) along with examples and a step-by-step guide.

External Article

DevOps 101 with Grant Fritchey

Additional Articles from Redgate

More and more organizations are turning to DevOps to improve the efficiency and quality of software delivery, and increase value to their business. But what exactly is DevOps and what does it mean for you and your organization?

Blog Post

From the SQL Server Central Blogs - Query Your Statistics: dm_db_stats_properties

Grant Fritchey from The Scary DBA

We’ve always been able to look at statistics with DBCC SHOW_STATISTICS. You can even tell SHOW_STATISTICS to only give you the properties, STAT_HEADER, or histogram, HISTOGRAM. However, it’s always...

Blog Post

From the SQL Server Central Blogs - Creating a distributed Service Broker application with Docker

Klaus Aschenbrenner from Klaus Aschenbrenner

As you might know, I have written a long time ago a book about Service Broker – a technology within SQL Server that almost nobody is aware of and...

 

 Question of the Day

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

 

Hyperscale Service Tiers

I want to provision a Hyperscale Azure SQL Database. What are my options for service tiers?

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)

Managed Instance Backups

What type of backups can be made on an Azure SQL Database Managed Instance?

Answer: Only copy only backups

Explanation: Only copy only backups can be run by users. Ref: T-SQL Differences in Managed Instance - https://docs.microsoft.com/en-us/azure/azure-sql/managed-instance/transact-sql-tsql-differences-sql-server

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
How to shrink LOB data in sql server 2017 - I have a huge table that stores pdf documents with datatype "image". Recently we started to offload files to blob storage, that is why we want to shrink main data file. All my tries to shrink the file wasn't successful. Usually, it stucks on 97-98% and doesn't go any further. Even shrinking by small chunks […]
SQL Server 2017 - Development
Blank space being imported during stored procedure - I have a stored procedure that imports a group of csv files.  The first field is called Initial and it always has 4 characters but is set to VarChar (50) because there are some blank lines at the end of the file and it will fail the import with a truncate error if I dont […]
Blank space being imported during stored procedure - I have a stored procedure that imports a group of csv files.  The first field is called Initial and it always has 4 characters but is set to VarChar (50) because there are some blank lines at the end of the file and it will fail the import with a truncate error if I dont […]
Behaviour of SSMS when scripting SPs has suddenly changed - Dear Experts I think this is an SSMS issue. My version is v18.10, aka 15.0.18390.0.  Honestly don't know where best to post this - please advise if it is out of place. Until recently, when I right clicked on an existing stored procedure and selected Script Stored Procedure As > ALTER to > New Query […]
SQL Server 2016 - Administration
Linked Server Error - I have three node AG - 2 synchronous in one data center and the other asynchronous in a separate datacenter. A linked server has been configured for years and running without issue until all of a sudden recently. To add to the confusion, I'm only getting the error message on one of the synchronous nodes […]
Development - SQL Server 2014
SQL Query Required - Dear All As per my request I have following input table Create table #FirstTable( StudYear int, StudValue varchar(20), SGPA float ) insert into #FirstTable values('1','Value1','5.6') insert into #FirstTable values('2','Value2','4.5') insert into #FirstTable values('3','Value3','3.2') insert into #FirstTable values('4','Value4','8.5') insert into #FirstTable values('5','Value5','6.5')   I want Out put in following table structure Create table #OutputTable( StudYear int, […]
AND syntax - Hello all, I am new to SQL, how to syntax 2 conditions connected with AND when trying to save value to variable? When I use code bellow there is no error but also no value displayed. SELECT @last_value = [VALUE] FROM dbo.TABLE_1 WHERE (IDMEASURE=(SELECT max(IDMEASURE) FROM dbo.TABLE_1) AND IDRESOURCE=27) PRINT @last_value
SQL Server 2019 - Administration
Log shipping broken after application upgrade - I have a weird situation regarding log shipping.  We back up the databases on our production database server every hour, and then restore to our reporting server.  This has been running for years. Last weekend, we upgraded our accounting system, and afterwards, log shipping stopped on the databases that the accounting system users.  There is […]
SQL Server 2019 - Development
What am I doing wrong with this subquery? - I am trying to return all values from the lookup table to columns on the same row for the Diagnosis code.   Here is my query: SELECT distinct a.accession_no as "Accession Number", (ISNULL((select m.code from medical_code m where ai.icd9_id = m.id and ai.sort_ord = 1), '')) + '~' + (ISNULL((select m.code from medical_code m where […]
cursor not getting next values - I've built this cursor to build a new diagcode from all the values in the cursor. The cursor is working in the sense that it's looping, but it's not getting the next "code" or value in the list. What am I doing wrong? Note: I am selecting a list of codes. then I have declare […]
populate a table with new data set but keep the original identity column values - I have a table like below, I would reset the values in the table with some fake addresses. I have already have the fake addresses ready without identity columns. But I would keep the original addressID in the table, so that other table use it as FK still works. Basically I want to keep the […]
Looking at startdate of one table and calculate the numbers from a different tab - I have such a situation. I have a table UDT_CKB_SNAPSHOT where we have different events (promotions). I need to take these event names, start dates of those events. I have a 2nd table called FCSTPERFSTATIC where we have Actuals and Forecast. What I need to do is basically is to look at STARTDATE of UDT_CKB_SNAPSHOT […]
Azure Data Factory
How do I pause and resume a Synapse dedicated SQL pool automatically? - Hi All, How do I pause and resume a Synapse dedicated SQL pool automatically? If it is in ideal state can I capture that and pause synapse dedicated SQL Pool? Could you please suggest. Thanks in Advance!! Regards, Ashok Kumar
Reporting Services
SSRS Long Text 2 Column report with some variables - I need to design what looks like a simple report.  However, it's 29 pages or so, 2-column, with a few variables mixed into the long text with various formatting throughout.  It seems simple enough.  However, I'm not sure how to even begin. I have the data set setup without issue.  I also have my parameters […]
Design Ideas and Questions
Need some example or answer for this doc - Need answer or data sample for this exam CMSC424 - Database Design SQL Assignment (Parts A and B) Fall 2007 (TENNIS DB SCHEMA) I trying test some tennis db like this doc, if someone has example with data test sample for test. https://ufile.io/dih6vn9a  
 

 

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

 

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