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

Surrender, Just a Little

Today we have a guest editorial from Grant Fritchey as Steve is away on his sabbatical.

I like to crack the joke that I’m a DBA, which means I’m a paranoid, control freak. The universe is out to get my data. Don’t believe me? Look up extra-solar radiation. Yes, as we travel through the universe, we occasionally hit patches of higher radiation. Now, look up the effects of radiation on disk storage. That’s right, depending on your shielding, you could get disk corruption as the Earth travels through the universe.

Now that you’ve joined in my paranoid cult, I hope you enjoy the cookies.

Seriously though, one of the harder things to do, especially as a DBA, is to surrender control. After all, the more things we control, the fewer things that can go wrong. Right? Well, actually, the more we try to control every single aspect of every single system, the more we become a bottleneck that stifles innovation and change. One of the most important lessons we can learn, as IT professionals, is to surrender, just a little. Find those places where automation will do a better job than we can do manually. Track down those spots where delegation means a faster process because we have more hands that can do the job. Identify the places where our process can be trusted, so our Mark I eyeball doesn’t have to be the only thing standing between success and disaster. Surrender, just a little.

Find the right places and stop trying to control them. This will free up time and effort for you to do more in the areas that matter the most. You’ll become less of a bottleneck and more of an enabler.

Grant Fritchey

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

Redgate Data Masker
 
  Featured Contents

Export/Import Data using BCP - SQL Server on Linux

carlos10robles from SQLServerCentral

In this article you will learn how to use BCP for SQL Server on Linux to export and import data using the BCP command line utility.

Cloning all the Databases on a Server

Additional Articles and Phil Factor from Redgate

Phil Factor shows uses SQL Clone and PowerShell to automatically create images of all databases on an instance, if they don't already exist, and then create or refresh clones of each one, on all your development servers.

SQL Server Attach and Detach Database Examples

Additional Articles from MSSQLTips.com

In this article Dinesh Asanka looks at how to detach and attach a SQL Server database using the SSMS GUI and using T-SQL commands.

From the SQL Server Central Blogs - Building the Monthly Newsletter for SQLOrlando

Andy Warren from SQLAndy

One the things I’ve been doing over the last year is sending out a monthly reminder email of upcoming events. Not revolutionary, I know. I’m sharing what we do...

From the SQL Server Central Blogs - New Pluralsight Course – Configuring and Managing Kubernetes Storage and Scheduling

aen from Anthony Nocentino's Blog

My new course “Configuring and Managing Kubernetes Storage and Scheduling” in now available on Pluralsight here! Check out the trailer here or if you want to dive right in go here! This course offers practical tips...

 

  Question of the Day

Today's question (by John Mitchell-245523):

 

Assignment of a value to a variable

What will be the respective values of j0, j1, j2 and j3 returned by this code?
CREATE TABLE #John (j int);
INSERT INTO #John (j) VALUES (1);
DECLARE @j int;
SELECT @j AS j0;
SELECT @j = j FROM #John;
SELECT @j AS j1;
DELETE FROM #John;
SELECT @j = j FROM #John;
SELECT @j AS j2;
SET @j = (SELECT j FROM #John);
SELECT @j as j3;

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)

Read Only Files

I have this python code:

with open("C:\Users\way0u\Documents\lotsofdata.txt", XXX) as data_file:
    # do stuff

What should I put in place of XXX to open this file as a read only file in text mode?

Answer: rt

Explanation: rt will open this as a read only text file. rb will open as  read only binary file. Ref: Python open() - https://docs.python.org/3/library/functions.html#open

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
Fetch IP address in query/job - Hi, I am trying to fetch IP address of the SQL Server through Query with below commands and it is working fine. But when I add it in a job it is not fetching/showing the IP. Please help. Select cONVERT(VARCHAR,CONNECTIONPROPERTY('local_net_address') ) select local_net_address FROM sys.dm_exec_connections WHERE SESSION_ID = @@SPID Problem is when i run this […]
SQL Server 2016 - Administration
Two beginner Availability Groups questions - Hello experts, I'm an accidental DBA who recently joined a new group, and I'm learning how to work with availability groups. Luckily, the more senior guys are patient, but I want to get up to speed asap and stop feeling ignorant about AGs. I have two noob AG questions I hope someone can help me […]
SQL Server 2016 - Development and T-SQL
Case when index scan faster then index seek (see example) - Hi, we had case today  where query   with index seek   provided  much   worst performance compare to   index scan. original query using 40+ union  and 5+ intersect ( it is machine build by java script..) I used AdventureWorks2017  to recreate similar scenario Step 1  create nonclustered index IDX_AG_001 on [Person].[Address] (AddressLine1) with(online =on) Step 2 set […]
Administration - SQL Server 2014
Transactions/Second - Hello.Does anybody have a way to identify what transactions ran in an interval (i.e. 1 minute or 5 minute)? I have Solarwinds telling me that the Baseline transaction rate is increasing 10 fold every 2nd minute - i.e theTransactions / second follows this pattern - 100 / 1300 / 100 / 1300......... Obviously this looks […]
Development - SQL Server 2014
SSIS Excecute SQL Task not executing simple T-SQL correctly. - Hello, I have an SSIS package with an Execute SQL Task that runs the following query: SELECT startDate = ISNULL (MAX (c.FileDate), DATEADD (dd, -8, GETDATE ())) , endDate = GETDATE () , fileDate = CAST(FORMAT (GETDATE (), 'yyyyMMddHHmmss') AS VARCHAR(16)) FROM stage.MI_ChildSupportFile c WHERE RecordType = 3 AND RecordSent = 1; There is no […]
SQL 2012 - General
How to update status with conflict data where chemical temp table have same chem - How to update status with conflict data where chemical temp table have same chemical Id on temp table #temp ? steps to achieve that 1- get related parts to part exist on temp table #temp that have same masked id from temp table #parts in this case result will be PartId MaskId ChemicalId 200 1000 […]
How to handle date on temp table when is null or not ? - How to handle date on temp table when is null or not ? I work on SQL server 2012 I using format dd/mm/yyyy I need to handle date on #temp table on both of from date or to date . if i have null on from date or to date what i do if some […]
SQL Server 2019 - Administration
SSMS Freezing when Editing SQL Agent Job Steps - I've spent several hours trying to overcome an odd technical bug on two SQL Server 2019 servers. I'm installing SQL2019 on WS2016 with SSMS18.4. Following a tried and tested routine (on previous versions of SQL Server),  I've installed Ola Hallengren's MaintenanceSolution.sql and scheduled the SQL backup jobs which work fine.  Problem is that when I […]
cardinality estimation - Just a quick question I'm putting in a new SQL 2019 server and an external consultant has advised that we should not use 2019 compatibility mode as there are issues with cardinality estimation - we should use 2017 compat mode I've googled this and found nothing. has anyone seen this ?  
RTO 15 minutes with differential backups - Hi. I'm working through the official exam reference book for 70-764 by Isakov and some of the sample questions + answers are driving me crazy! One such example is for a question which asks you to come up with a backup strategy to meet a set of requirements, one of these requirements being that the […]
Recruitment question - Thanks for fielding this question in advance: We are searching for a Microsoft SQL DBA in the NYC area... haven't had any luck sourcing candidates on all the normal job posting sites and LinkedIn. Any advice?
SQL Server 2019 - Development
Deleting duplicate records with a CTE - This code is modified from an example I saw.  The purpose is to delete duplicate records. WITH DupRecords AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY fName, EmpID, Department, City ORDER BY ID) AS RowNumber FROM dbo.DeleteDuplicateRecords ) DELETE FROM DupRecords WHERE RowNumber > 1   The table with duplicates is called dbo.DeleteDuplicateRecords.  DupRecords is […]
SQL Group by in STUFF function - I have one question in SQL and would like to take some help from you. I am using the below query to group by based on the test results and then can able to send these results to the recipients. SELECT alertQueue.[Prod No] AS ProdNumber , SUBSTRING(alertQueue.[Prod No], PATINDEX('%[^0]%', alertQueue.[Prod No] +'.'), LEN(alertQueue.[Prod No])) AS […]
Azure Data Factory
Blob to ADF to Stored proecure - I'm reading file from BLOB through ADF and I would like to pass the whole content of the file to stored procedure..Is it possible? If so,  can somebody give me some pointers? Thanks.
Analysis Services
Attribute in the hierarchy display as one value - Hello Friends, I want to display the attributes in a hierarchy as one value in the cube. Just the last leaf level. Please refer the below image. Is it possible to display as '11A Base Maintenance' ? I am wondering if this is possible in cube by adjusting some properties instead of doing through ETL/database.
 

 

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

 

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