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

Daily Coping Tip

Eat mindfully. Appreciate the taste, texture, and smell of your food

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.

Nothing on My Laptop

I heard this quote at the recent Redgate Summit: "If I drop my laptop in water, I can get everything back." The context of the quote is that all your work, your IP, your code, etc. is saved in some common or duplicate location. Everything essentially has a backup.

I learned the lesson early in my career that keeping one copy around of things was bad. On an old Apple II, I formatted the wrong disk numerous times, necessitating me recreating homework multiple times on a very tight schedule. Over the years, I often made sure I had some backup service, but things really changed for me about ten years ago.

I had a laptop die on me while on the road. I had copies of things in different places, and a backup service, but I had to buy a new machine and get things set up quickly. It was a pain, but I started to adopt the DevOps idea of improving my system and learning what worked. Today's cloud services, as well as package managers (Chocolatey) helped me. A few years ago my laptop blue screened and I had to reformat the drive and rebuild everything for a presentation the next day.

It took my about 3 hours, thanks to code, document, and more stored and available in different services. These days, I think I was up and running on a new laptop in tens of minutes, and had most of my bits available in Explorer or inside an application in a little over an hour.

These are great habits to ensure I can continue to work, and good for home where I don't want to lose photos or other digital assets.  These are also good ideas for shared work inside an organization, whether on workstations or servers. Don't operate without a way to rebuild systems, including configuration and data, if something fails. Cultivate cattle, not pets, as the DevOps people say.

Steve Jones - SSC Editor

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

 
 Featured Contents

Google Cloud Certification for Microsoft Database Engineer

Daniel Klionsky from SQLServerCentral

Introduction I recently passed the Google Cloud Professional Data Engineer certification exam, Professional Data Engineer Certification. It took me about five month to prepare for this, and I would like to share my thoughts of why I decided to take it on and how I prepared for it. At the moment, Google cloud (GCP) is […]

SQL Server authentication methods, logins, and database users

Additional Articles from SimpleTalk

Understanding SQL Server security is a critical skill. Greg Larsen explains SQL Server authentication methods, logins, and database users in this article.

What is Azure Databricks?

Additional Articles from SQLServerCentral

The goal of this article is to illuminate exactly what Azure Databricks is so that you can determine what parts of the platform might make sense to add to your organization's data stack.

From the SQL Server Central Blogs - How SQL Server Synonyms Help Database DevOps

SQLEspresso from SQLEspresso

Synonyms inside SQL Server are one of those useful but forgotten features. A synonym is a database level object that allows you to provide an alternative name for another...

From the SQL Server Central Blogs - Right sizing int : T-SQL Tuesday #136

Kenneth.Fisher from SQLStudies

Brent Ozar (blog|twitter) is our host this month, which will make this the most popular #tsql2sday to date I’m sure. ... Continue reading

 

 Question of the Day

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

 

Setting the Legacy Cardinality Estimator

I am working with a SQL Server 2019 instance and have a number of queries in a database that are not performing well. This is a database in compatibility level 150 (SQL 2019), but I find with testing that many queries perform better under the legacy cardinality estimator. How should I change this setting for only one database?

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 Git Default Branch

How can I set the default branch for my local git (v2.28) software to main?

Answer: git config --global init.defaultBranch main

Explanation: Starting with git 2.28, you can set the default branch as a config option with the init.defaultBranch setting. Ref: Introducing init.defaultBranch - https://github.blog/2020-07-27-highlights-from-git-2-28/#introducing-init-defaultbranch

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
Stopping the SQL Server Agent before a datacenter shutdown - I have read different opinions on whether to manually shut off the SQL Agent service before shutting down a SQL instance for 2 days; some believe the server being off is perfectly fine, and others have said to manually stop the Agent and manually start when the server/instance is turned back on. To me the […]
SQL Server 2017 Dev Certificate error - Error Message attempting to download data from my SQL Server 2017 dev edition. 0 - The certificate chain was issued by an authority that is not trusted. I've tried so many suggestions and it's probably because I'm not a certificate expert. So. Two questions. As a person with limited DBA experience with advanced settings, how […]
SQL Server 2016 - Administration
Upgrade to larger drive - I have a drive D: with both the .mdf and .ldf files for a number of databases that's running out of space. I was wondering, if I: Stop the server Copy the files to an external drive Swap out the D: drive with a new one that's bigger Copy the files back Start the server […]
Removing Stopped Databases - Greetings all,  first post.... In doing backups with our Cohesity system it reports errors with a few databases which lead me to investigate the cause.  Basically these are stopped databases on the Microsoft Server 2016 / MSSQL 2016 server systems.  The SQL Configuration Managers shows them as stopped.  These particular databases were moved to other […]
SSRS - Object reference not set to an instance of an object -     Hi All SQL Server version: 2016 SP2 CU13 I have one particular report that keeps giving me the error below....All other reports work just fine. An unexpected error occurred in Report Processing. (rsInternalError) Object reference not set to an instance of an object. According to the Execution log, the report ran last a […]
Administration - SQL Server 2014
SQL keeps crashing - Hi, This is similar to a previous post 5 days ago. SQL server is not responding. You can't connect via ssms or odbc or run anything. The CPU is at 5% and the memory is at 75% so nothing concerning there however around the time of the connections dropping off and staying off there is […]
Development - SQL Server 2014
Stored Proc. Date parameter loop - Morning, I have a SP that I created that does select query, using a date parameter.  Because of a few joins the query takes a little long to run. and present in an app. What I thought of doing is changing the SP to a Insert select, and pre-fill a table with results needed,  and […]
SQL Server 2019 - Administration
SSRS report download fails - Hi. I am trying to download a report from SSRS 2019 in word format and fails with error as below: An error occurred during rendering of the report. (rrRenderingError) The type initializer for 'MS.Utility.EventTrace' threw an exception. Requested registry access is not allowed. Same case with Excel. Only PDF works. The cases when I am […]
SQL Server 2019 - Development
Can I update an Excel file from SQL database? - I am not sure this the right place to post this but, Is it possible to update an Excel file from an ODBC SQL database? I only want to add new entries and not refresh the existing data in the Excel file. The reason for this is there is "legacy" data in the SQL database […]
'Must declare the scalar variable' error msg. - I have a simple query, however I am failing to understand the issue in my statement and getting below error: SQL Statement: select @V_Cnt=count(0) from information_schema.tables Msg 137, Level 15, State 1, Line 15 Must declare the scalar variable "@V_Cnt". Count: 0 My Query is: declare @V_Cnt int=0; declare @V_sql NVARCHAR(MAX); declare @Print nvarchar(1)='E'; -- […]
Wait for query to finish before returning results - When I do "select * from ... " from a large table, the result starts to "stream" before the query is completely done. Is there a way to prevent this? Some kind of oppositve of the "FAST" queryhint?
Many executionplans for one query, why? - I've yet to find an answer for this. I've found a few queries that have a few executionplans. Why is that? For example, I've seen queries (in QueryStore) that has executionplans A and B (and more)... For a few days the query uses A and then goes back to B, and then back to A […]
Reporting Services
SSRS Dynamic columns for different Year groups - Hi,   I have sample data, please can someone help me create the output based on the following data? So asically in SSRS when year 6 is selected it should populate the output below for Year 6, Year 7 populate the output for Year 7.   CREATE TABLE Data ( StudentId int, intYear int, ,subject […]
History Snapshots - Bulk create for many reports - Hi guys, just found the History Snapshot Option within SSRS. Do you know if there is a way to create a schedule that will be used by every report. E.G. I want to take a history snapshot of every report with a retention of 24 hours. Then the snapshot should be deleted. Maybe you can […]
Powershell
parse files in folder - I have a project where I need to search a folder and based upon passed in parms to the script do a lookup in each file for those values and copy that file to a new file.  I used the following to search a folder: Get-ChildItem -Path '\\srv1\archive\' | Select-String -Pattern "793383355" Now my requirement […]
 

 

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

 

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