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

Daily Coping Tip

Listen to a piece of music without doing anything else

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.

Easily Repeating Work

I love this idea from Ken Fisher: saving your work. I don't act as a DBA anymore, but when I did, I did something similar. We often logged the scripts we used in a file,  as a part of a log, so that if we broke something and another DBA got a new ticket, they could check what you had done. Over the years, we tried two different methods. First was using the desktop of the instance itself, since we often went to a room to log into the server in those days

The second way was in an Exchange public folder, where we added a new entry for each day. This way we could note the server and the scripts run. Since most tickets were dated, we could easily find the scripts if we were looking at a ticket. Since a user often updated or re-opened the ticket, we could use the public folder as a central note location from the DBA team. We could even point to this folder for our ISO and SOX auditors to show them what had been logged by people who supported the systems.

However, the one thing missing in there, from my perspective, is version control. While I think it is important to track these scripts in a team of DBAs, I also think we want to ensure that as we grow and change this scripts, we know how and why. A DBA might alter one of these scripts and break something, just as developers refactor code and introduce bugs or break functionality. After all, these scripts are code.

If there is a problem, we want to be able to roll back, which means that we ought to save these scripts into a repository of some sort. While I like the idea of a share that all DBAs can access, I more like the idea of a (secure) Git repository that can be downloaded anywhere, provides a backup in another location, and can be audited over time. All of these are important features that any enterprise, especially one that is regulated, should implement.

DBA person gets hit by the proverbial bus.

I like collaboration, sharing knowledge, and tracking the work you do in a team. It's important for raising the skills of everyone on the team and helping new members get up to speed quickly. This facilities consistent results, and if done using a tool like version control, helps ensure that your scripts are backed up in a way that preserves the knowledge in your code through any changes made by the team.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

Cloud Computing Basics - Achieving High Availability

Br. Kenneth Igiri from SQLServerCentral

Learn about high availability in the cloud at a conceptual level.

External Article

Choosing Snowflake vs SQL Server for a Data Warehouse

Additional Articles from MSSQLTips.com

In this article we take a high level view of choosing to use Snowflake in the cloud versus SQL Server on-premises and some things to consider.

External Article

DevOps 101: Getting buy-in across your organization

Additional Articles from Redgate

Implementing DevOps isn’t just a matter of being great at writing code. The key to successful DevOps implementation is gaining buy in across your organization. Join Grant Fritchey live for his tips on how to achieve this.

Blog Post

From the SQL Server Central Blogs - Shift calculations (or same time every day)

Kenneth.Fisher from SQLStudies

One of the more interesting jobs I’ve had over the years was for a company that created emergency room software. ... Continue reading

From the SQL Server Central Blogs - Using Azure Blob Storage in Power Automate

Devin Knight from Devin Knight

In this video, Devin you will learn how to setup an Azure Blob Storage account and then use it in Power Automate. With Power Automate

 

 Question of the Day

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

 

Azure Locks

In a resource or subscription in Azure, I can set a lock to limit actions. What are the two lock levels I can set?

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)

Data Analytics Classification III

I am asked to build reports that will help a business analyst determine what factors to change in order to increase revenue by a factor of 2. What type of data analysis is being performed for this task?

Answer: Prescriptive Analytics

Explanation: Prescriptive analytics helps answer questions about what actions should be taken to achieve a goal or target. Ref: Explore Data Analytics - https://docs.microsoft.com/en-us/learn/modules/explore-concepts-of-data-analytics/4-explore

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 2016 - Development and T-SQL
Bulk Insert Truncation and Try Catch - I ran into an issue where using bulk insert to load a text file with a field having a length greater than the length specified in the table will not be picked up as an error using try...catch. Here is an example of what I mean. The text file is attached and is tab delimited […]
Concatenate two rows into one row being returned - I have a temp table that returns the following: Month     Year 09             2021 12              2021   And, I was the following returned: 09-12-2021.   Is this possible?
Development - SQL Server 2014
Export csv file with Headers having double quotes but not all data row. - I am trying to export a csv file where the header column are all double quote delimited but only the string data has double quotes.  Im not sure SSIS can do this. Any ideas? e.g. "A String","B String","C Number" "abc","def",1 "bob","builder",4
SQL Server 2019 - Development
can not get cursor to work for me - use Joedata go DECLARE @CursorID INT; DECLARE @ViewSite varchar(12); DECLARE CUR_Loop CURSOR FAST_FORWARD FOR SELECT distinct IndexSite ,[IndexWeekOf] ,[IndexMonth] -- ,[IndexSite] ,[IndexDepartment] ,[IndexSpecialty] ,[IndexSkillNumber] ,[IndexSkillset] ,[id] ,[CalcCallsOffered] ,[CalcAdjOffered] ,[CalcAdjAban] ,[CalcAbanPercent] ,[CalcASA] ,[CalcTalk] ,[CalcHold] ,[CalcACW] ,[CalcAHT] ,[CalcOccupancy] ,[WaitTime] ,[AverageAbandonTime] ,[CalcPercentAns] ,[CalcAdjPercentAns] FROM [Joedata].[dbo].[tblUSHC_SkillDailyCalc] ORDER BY ID; OPEN CUR_Loop FETCH NEXT FROM CUR_Loop INTO @CursorID WHILE @@FETCH_STATUS […]
GETDATE - number of dates - a column / division in SQL - I need to do such a calculation. (Get today's date - 219 - HISTSTARTDATE) / 7 AS 'Weeks Of History' When I do it like this (DATEDIFF(DAY,0,GETDATE()) - DATEADD(DAY, -219, GETDATE()) - HISTSTART) / 7 AS 'Weeks Of History'   I am getting an error which says 'The data types datetime and date are incompatible […]
Need a Query to output data in a specific format - We have a data set from SQL. We need to move the "Team" values for all matching ObjectIDs into one row. I have an image of what is needed, Fig.1 If possible, we need to have the output formatted as the "DesiredOutput" section in the Fig.1. The query that we have now is: SELECT Personnel.ObjectID […]
SQL Select date - Hi all , I have fiscal year date is from Oct 1 to Sept 31 every year. I would like to have a SQL select statement to load 2 fiscal years of history + current fiscal year. For example, if i run now it will return all records with date Oct 1 2019 -present fiscal […]
Using OPENJSON to extract child subgroups from JSON file & link them to parent - Hi there I have a sample JSON file,.. from which I am attempting to extract data from using OPENJSON in SQL. Now the file is broken down in the 3 main sections: 1) Return 2) Customer 3) Address Now I am able to extract the Return and Item information . However Ive got 2 issues: […]
SQL Azure - Administration
Backing up an Azure SQL Database hosted on Azure VM onto an Azure File Share. - Team, Can we create a credential using SAS Key for an Azure File Share with extension .file.core.windows.net and Backup an Azure SQL Database onto it; Right Now i receive the Error "Error while decoding the storage key." With Thanks, Satnam    
Reporting Services
Unable to hide the text box - Hello all I am writing the following condition to hide the textbox based on a condition but some how it is not working I am able to set the value =IIF(FormatDateTime(Parameters!LiveDt.Value,2) < FormatDateTime(Parameters!visitdt.Value,2), "True", "False") =FormatDateTime(Parameters!LiveDt.Value,2) < FormatDateTime(Parameters!visitdt.Value,2) I am able to see the text correctly based on condition but unable to hide it
Using a Stored Procedure in SSRS Report Builder - I have a SQL Stored Procedure that works great for one of our applications we use for cost reporting. I want to try and use the same SQL Stored Procedure in an SSRS report. I am able to copy the the Stored Procedure into Report Builder with no issues, but I can never get any […]
Powershell
get file name during loop and insert into Table - I'm running this script to loop thru tables and insert the timestamp and wirespeed based upon latest updated record in table. I would like to add another field to table bc_staging called equipid and grab the file name during the loop. I can see the value in the statement write-host "Processing" $Row.name that I want […]
Integration Services
How to read URL which has PDF format in SSIS - I Have a URL when we browse on the UI it open the PDF file. Here is the sample URL- https://abciruat.net:1223/ASDFLink/VisualServerget&pVersion=0046&VisualRep=D1&docId=737474784&VisId=data&accesMode=r&authId=SD%12%33%4565%556%84WebAS%20O%%20C%3DDE&expiration=20210908165305&secKey=MIIBUgZI   When we browse the above sample URL it opens content in PDF format. My requirement is how can i use this URL in SSIS using script task and download the PDF from this […]
The Future of Community
Voting for Sessions on GroupBy.Org starts today!!!! Please vote!!! - Please help that SQL Server centric community and vote for your favorite sessions that you'd like to see during the even.  There's a link at the top of the pages (on for the Americas and one for Europe) that has more details.  Here's the link https://www.groupby.org/vote-now/ Once you're done voting for your favorites, vote for […]
T-SQL (SS2K5)
Cannot resolve the collation conflict - Hello!   Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_BIN" in the equal to operation I have two tables - Table1 as linuxdata ( only one column and that is UID - nvarchar(50) Table2 as coumputerdata (columns: id (uniqueidentifier) , name(nvarchar(63),   importid(nvarchar(80) .. and so on) UID of table1 and importdid of table2 has […]
 

 

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

 

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