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

Daily Coping Tip

Take a full breath in and out before you reply to others

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.

Take Care of People

Many organizations are undergoing changes. The pandemic of the last year has them rethinking their physical spaces, but also the need to hire in their local area only. Add to this the cloud transformation that seems to be a growing trend in many organizations and industries. Then we have the DevOps changes occurring in technology, affecting developers, testers, and operations staff.

As I've learned more about this, listened to stories, and watched presentations, one thing I think starts to stand out for the high performing organizations is their commitment to taking care of people. Not everyone, but most of them giving them education, opportunities, and options.

As we adopt DevOps, or really any substantial change, we may find that our existing staff doesn't fit the new paradigm, or we need more or less of them. Good companies work with people, they help them, transition and adapt. They reassure them that change doesn't mean a loss of a job, even if their current role is going away.

I've seen big companies do this. Microsoft, American Airlines, and Capital One do this, among others. They create pathways and help staff gain skills and find opportunities. Not everyone wants to continue forward, but they do have the choice to do so.

If your company wants to transform, or you want them to, don't forget that part of this journey is bringing people along with you. Creating pathways that help both the technology and the staff get to a new place from where they are today.

Steve Jones - SSC Editor

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

 
 Featured Contents

Using Non-SQL Languages in Azure Data Studio

Steve Jones - SSC Editor from SQLServerCentral

In this article, we examine the support for non-SQL languages in Azure Data Studio, primarily PoSh and Python.

Delete SQL Statement in SQL Server, Oracle and PostgreSQL

Additional Articles from MSSQLTips.com

Learn about the differences and similarities when deleting data from SQL Server, Oracle and PostgreSQL with the several examples in this article.

Reusing Query Results in SSMS

Additional Articles from Redgate

Every time you need to reuse the query results from SSMS, for example to populate another table, or to search for matching rows in another table, it will inevitably mean a lot of manual tweaking to the get the results into the right format. Louis Davidson uncovers three SQL Prompt gems that can remove all this pain.

From the SQL Server Central Blogs - Data dictionary script

Diligentdba 46159 from Mala's Data Blog

I restarted speaking with New Stars of Data today – I gave a talk on Database documentation. Below is the script I created to pull metadata into an excel...

From the SQL Server Central Blogs - T-SQL Tuesday Retrospective #011: Misconceptions

Randolph West from Born SQL with Randolph West

(If you would like to read the previous T-SQL Tuesday Retrospective entries, visit this link.) In October 2010, Sankar Reddy asked us which misconceptions we’ve been labouring under when...

 

 Question of the Day

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

 

The CTE Scan

I have this code to create and query a CTE on the AdventureWorks2017 database:
WITH Customers AS (
  SELECT CustomerID
  FROM Sales.Customer)
SELECT *
FROM Customers
UNION ALL
SELECT * FROM Customers;
How many times is the Sales.Customer table scanned?

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)

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?

Answer: Set the database scoped config option

Explanation: While you can use all of these techniques for a query(ies), to set this for a database, post SQL Server 2016 SP1, you should use the Database Scoped Configuration option, LEGACY_CARDINALITY_ESTIMATION. Ref: Alter Database Scoped Configuration - https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-scoped-configuration-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
Connecting to SQL 2017 with SQL Server Driver from Windows 2012R2 - Hi we have a legacy application that connects from the application servers (Windows 2012 R2) to the SQL servers using the SQL Server driver. This work fine against an old version of SQL, but we're upgrading to SQL 2017, and it no longer connects. You can connect from Windows 10 using the SQL server driver. […]
Most accessed tables/indexes - This is a generic question to know more about SQL server performance.Nobody has complained of any performace issues on our servers, but there is an agenda to know the existing performance and how that can be improved upon. What are the metrics that need to be captured to identify a baseline for a sql server […]
Data type for large text. - Hi, I have a table I am importing from excel where are few of the cells have a length of 450. What data type should I use when I create the table? Varchar(MAX) or should I use something else. Using sql server 2017.   Thanks
SQL Server 2017 - Development
GROUP BY with SELECT SUM - Why is this not working? Field 'EmpNo' not contained in either an aggregate function or the GroupBy clause SELECT EmpNo, SUM(Time1) AS TotalTime, Dept, Job, Description, Rework FROM TimeData2 GROUP BY EmpNo
Errors using XML value method - I'm having issues using the xml value method to convert an XML COlumn to values and the answers I've tried have not worked. My XML Column appears as follows 42702e49b4 f3db96464e I've tried Select transit.value('/Transit/docid)[1]','varchar(50)') as docid from Client and […]
SQL Server 2016 - Administration
Licence SQL server Edition developper sous une machine EC2 - Good morning all Can I take advantage of the fact that the SQL develop license is free to install it on EC2 AWS machine?Is the use of SQL developing ON EC2 AWS free thank you for your clarification
Logon Trigger security context - I recently had to create a logon trigger to track what appeared to be unused accounts, putting the logon, IP and time into a table in my Management database. The aim being to see if the accounts are still being used, when and from where. The code was pretty simple: create table DBAManager.dbm.tbl_LogonTrack ( LogonTrackID […]
Administration - SQL Server 2014
Shutdown order for nodes in AG and quorum disk - When shutting down the whole farm environment with two nodes in Failover Cluster/AG, my thinking is to shutdown secondary first and then primary. When bringing up, start with primary and then the secondary. What I noted was when the secondary was brought up first and then the primary, the databases synced and AG dashboard showed […]
Excessive Blocking despite Read Committed Snapshot Isolation - I've got a DynamicsAX database that's seeing a significant amount of blocking despite having RCSI set and the connections using Read Committed. This Microsoft article ( https://docs.microsoft.com/en-us/sql/t-sql/statements/set-transaction-isolation-level-transact-sql?view=sql-server-ver15&viewFallbackFrom=sql-server-ver12 )  confirms that there should be far less blocking, under the READ COMMITTED section it says: If READ_COMMITTED_SNAPSHOT is set to ON (the default on Azure SQL Database), the […]
Development - SQL Server 2014
Sql query - Projected Monthly Revenue - Hi, I've been sitting with a projected revenue query for sometime , trying to figure out the best way to do this. Basically, I'm trying to get a monthly revenue number based on daily shipment totals. eg:  Total Rev MTD  $88,720 / 9 days =  $9,857 *  23 shipping days = $226,731 as Monthly Project […]
Clone a table from a script - I have a table schema in an exported .sql file (text). Is there any way to use that to create an identical table (with the name changed of course)? The file was created using script table as -> create to -> file. TIA  
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 2012 - T-SQL
Help filtering my WHERE clause - Hi, I work in a hospital and look after a db containing the surgical procedures performed on our patients. I am trying to write a query that will count the number of specific combinations of procedures performed by our two surgeons but I'm struggling to extract just the right patient records. I have attached a […]
SQL Server 2019 - Administration
Encrypt/Decrypt issue - Version :Microsoft SQL Server 2019 (RTM-GDR) Followed these links as underneath: https://www.mssqltips.com/sqlservertip/2431/sql-server-column-level-encryption-example-using-symmetric-keys/ https://www.surekhatech.com/blog/column-level-encryption-and-decryption-in-mssql I created 2 tables. For the first table I inserted individual rows (with encryption as in the links) and when I did a decrypted select.The result came out perfectly.No issues.The result showed the original password column,encrypted password column and then the decrypted […]
Integration Services
Execute PowerShell script, via Execute Process Task, results into a Table... - I'd like to Execute PowerShell script, via Execute Process Task and store the results into a SQL Table. Can this be done? If yes, could you point me to an example? Thank you
 

 

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

 

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