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

Daily Coping Tip

Send someone a message to say how much they mean to you

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.

Anyone Can Click Through Once

I was watching some of the Virtual Summit conference content (which is still available) trying to catch up on a few sessions that I missed during the event. One of the sessions I watched was a PowerShell panel. In the panel, Ben Miller (b | t | L) said that "anyone can click their way through something once."

I agree with that. It's really easy to run through something once, even a long wizard or install process. Most of us find it easier to just get something done than work on a script to complete it. Often, I find myself doing this for tasks that I tackle rarely, like installing SQL Server. With the growth of containers, I rarely install SQL Server anymore, but the few times I might want a VM outside of a cloud system, I find it easier to just run the install than find a script and alter the settings.

However, there are tasks I need to repeat. Anything that I might need to run more than once or twice, I usually do think about scripting. I look at T-SQL and PowerShell, both of which are very useful, but have different times and places where they fit better. The key, however, is that running a repeatable process is easier when it's scripted.

This is true whether you are doing something for yourself or for your employer. When you have to repeat a series of steps, it's too easy to forget one or make a mistake. Maybe more importantly, as more companies adopt DevOps automation and pipelines, the need for command line automation and logging is critical.

One of the panelists noted that they think PoSh is critical for your career and wouldn't hire someone that didn't know the technology. Not everyone agrees, but the tremendous growth of systems, the need to often deploy changes using automation, and the likelihood that you will see PoSh on the Microsoft platform, I tend to think this is something employees will strongly desire.

Steve Jones - SSC Editor

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

 
 Featured Contents
Stairway to Advanced T-SQL

Stairway to Advanced T-SQL Level 5: Turning Data On Its Side Using PIVOT Operator

Greg Larsen from SQLServerCentral.com

The PIVOT operator was added to the Transact-SQL language in SQL Server 2005. It allows you to turn your row data on its side, so it can be presented as column data. This is useful when you want take unique column values and have them displayed as column headings, where the column headings are associated with summarized values displayed below each column heading. In this article I will be exploring how to use the PIVOT operator.

Gitflow Workflow Hotfix Branching for SQL Database Projects

Additional Articles from MSSQLTips.com

Git is a great tool for source control and in this tip we look at how you can utilize Git source control to build and deploy database hotfixes.

The Future of Database DevOps

Additional Articles from Redgate

Join Pramod Sadalage, Director at Thoughtworks, and a stellar line up of speakers for Redgate Summit: The Future of Database DevOps on February 17 & 18. You’ll discover the latest trends in DevOps, brand new insights from the 2021 State of Database DevOps report, an introduction and technical demos of Redgate’s solutions for Database DevOps, and more.

From the SQL Server Central Blogs - Launching On-Demand Training Platform SQLibrium

kleegeek from Technobabble by Klee from @kleegeek

I am thrilled to announce the launch of a new education initiative called SQLibrium. For years, I’ve traveled the world educating technical audiences on deep-dive topics around how data and...

From the SQL Server Central Blogs - Power of Unlearning

Rayis Imayev from Data Adventures

(2021-Jan-31) Working on DIY home projects is always fun, choosing the right tools: whether I handle paperhanging scissors to cut my wallpapers, or create an opening and trim my drywall...

 

 Question of the Day

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

 

Python List to Tuple

In Python 3.7, how do I convert this list into a tuple named "days"?
AllDays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']

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)

Basic Availability Groups

In which edition(s) of SQL Server 2019 can I run Basic Availability Groups?

Answer: Standard only

Explanation: Basic Availability Groups are only in Standard edition. Always On AGs are in Enterprise only. Web allows neither of these. Ref: Features and Editions of SQL Server 2019 - https://docs.microsoft.com/en-us/sql/sql-server/editions-and-components-of-sql-server-version-15?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 - Development
How to extract text after a given string to look for. - I am a forever learning new DBA. I have been handed a project I have no idea how to complete. I have a table that has a column called settings. In that column there is a massive string of data. Within that string of data I must extract out a single setting. The text I […]
SQL Server 2016 - Development and T-SQL
Adding new column to GROUP BY vs adding MIN or MAX of that column - I have a straightforward report, which performs some calculation, e.g. SELECT myCustomerId, customerProductId, SUM(totalSpentByCustomerForProduct) AS totalPerProductPerCustomer FROM customersTable JOIN ordersTable ON ... JOIN productsTable ON ... GROUP BY myCustomerId, customerProductId Now I need to extend it, providing both customer and  product names. Normally I would implement it by adding MIN (customer_name), MIN (product_name) to the […]
Python call of a Stored Procedure with send_dbmail does not work - Hello,   I have a python script (version 3.8) which then calls the Stored procedure in a database (with all the required params: databasename, user,pwd) The SP has an update within Begin/End trans. If the Update fails then I have an EXECUTE [msdb].[dbo].[sp_send_dbmail] to send me an alert email. That doesn't work from the Python […]
Administration - SQL Server 2014
How to find lock scope from DMVs? - Hi all, I am testing my data purging (deleting) procedure, and while it's running I monitor sys.dm_tran_locks. It shows everything for every lock, but not a scope (like row or page). Or maybe I should check in another DMV? Thanks    
Trying to create key - Hi I had to drop a constraint to run an update. The drop was fine but when I run the create statement: ALTER TABLE [dbo].[PEC_Claim_Supp] WITH CHECK ADD CONSTRAINT [FK_claim_PEC_Claim_Supp] FOREIGN KEY([claim_id]) REFERENCES [dbo].[claim] ([claim_id]) GO ALTER TABLE [dbo].[PEC_Claim_Supp] CHECK CONSTRAINT [FK_claim_PEC_Claim_Supp] GO   I get the error: Msg 1776, Level 16, State 0, Line […]
Development - SQL Server 2014
How to delete in small chunks - Hi All, We have a large log table which consists of last 10 year data. When we are running a delete on such big table which has some LOB columns as well. So as a result, we are facing 9002 log full error. So, want to come up a purge script which can delete in […]
Query is not giving me expected output. - Below is query with data,which is not giving me expected output. DECLARE @StartDate date = '03-06-2020'; DECLARE @enddate date = '06-06-2020'; Create table #ItemMasterFile (Codeitem int,Descriptionitem varchar(50),Packsize varchar(50)) Create table #Bigbalprd (B_ID int,Codeitem int,Bpqty int,Bweight int,Entrydate date,delid int) Create table #DispatchBM (DID int,Name varchar(50),Date date,Del int) Create table #Dispatch_BD (ID int ,BID int,DID int,Codeitem int,QTY […]
SQL Server 2019 - Administration
What TLS version is used: how? - Hello, Is there a way to find the TLS-version used in connections on SQL Server 2019? I'm getting The event name, "sqlsni.trace", is invalid, or the object could not be found when I try to add extended event sqlsni.trace CREATE EVENT SESSION [tls] ON SERVER ADD EVENT sqlsni.trace( WHERE ([sqlserver].[like_i_sql_unicode_string]([text],N'%Handshake%'))) https://www.sqltact.com/2018/01/sql-server-on-tls-12-xevent-session-to.html
SQL Server 2019 - Development
function output - Hi Expert,   I am troubleshooting this function and unable to understand the actual output from it . could you please explain it   SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO   ALTER FUNCTION Create funciton dbo.test1 ( @List nvarchar(2000), @SplitOn nvarchar(5) ) RETURNS @RtnValue table (   Id int identity(1,1), Value nvarchar(100) ) AS BEGIN   While (Charindex(@SplitOn,@List)>0) Begin   Insert Into @RtnValue (value) Select Value = ltrim(rtrim(Substring(@List,1,Charindex(@SplitOn,@List)-1))) Set @List = Substring(@List,Charindex(@SplitOn,@List)+len(@SplitOn),len(@List)) End   […]
T-SQL (SS2K8)
Count consecutive number of years of orders - Hi I like to get the number of consecutive years a customer have placed ordres starting from current year or last year Input 2015 2016 2019 2020 2021 Result = 3 I hope someone can help with this.  
SQL Azure - Administration
Looking for info on azure active directory authentication - We have an Azure DB in place and now need to make it accessible to a number of on prem AD users. I'm told there is a way to do this via azure active directory authentication. Any recommendations on articles on how to do this? Everything I've found is about creating the azure active directory […]
Integration Services
OLE DB Source Dynamic Source Name - Hi All, Using VS 2017 I have a for each loop using a variable @currentfile to pass the file name of the excel file which changes every time it runs and the excel headers start in row 3 and column B to BO. I've tried using a excel source with the SQL command SELECT * […]
OLE DB Source Dynamic Source Name - Hi All, Using VS 2017 I have a for each loop using a variable @currentfile to pass the file name of the excel file which changes every time it runs and the excel headers start in row 3 and column B to BO. I've tried using a excel source with the SQL command SELECT * […]
Flat File Connection Manager issue - All, Firstly apologises as I think I've missed the obvious. I've been looking at this for a while and also tried searching but not found an answer. This is the XML for a Flat File Connection Manager: @[$Package::FilePath] + "\\Location.csv"
Disaster Recovery
SQL Server Failover Cluster - First sorry for my English, I am French speaking I've searched and did not found any information on how to do this. Let me explain (see file attached) I know how to setup an SQL failover cluster, did it and it works perfectly. Here is my situation : Node1 and Storage A is in […]
 

 

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

 

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