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

Daily Coping Tip

Make some progress on a project that matters 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.

Who is the best person for the job?

Today we have a guest editorial. Steve was supposed to be on vacation out of town, but is mourning his inability to do so.

In some bigger companies, there can be more than one DBA or database professional.  In the previous company I worked for, I was the only database professional, so anything database related came to me.  Of course, this also helped hone my database skills, since I had to find solutions to things I was unfamiliar with.  In some ways it was nice to be the go-to guy.  It gave me a feeling of purpose, knowing I played an important role that no one else could play.  Unfortunately, I also had to deal with some things I wished could be someone else’s problem.

The company I work for now is a much larger organization with many more database professionals.  There are a number of different groups and systems.  Several of the systems integrate with each other.  On some occasions we have queries that span multiple databases.  This is especially true for some of our reporting systems.  A few of these databases I am very familiar with, since I work with them every day.  I understand the tables and the structures and know where the data resides.  I am not as familiar with some of the other databases.  They still have tables and are normalized, but I just haven’t spent as much time with those systems.

Know how sometimes you start to get to be known for certain things in your job?  Or perhaps you helped a coworker with their query problem, so they start to come to you first no matter which system they are working with.  This happened to me recently.  I have become the go-to guy for database problems or questions in the group I am in.  My coworkers usually come to me first when they have a query problem or performance issue or just a question about anything related to the databases.  Anyway, a query with a performance issue came my way.  The query that wasn’t performing spanned two databases.  The main database in the query was one of the ones I am not as familiar with, but it was joining to a database that I know very well.

As I looked more closely at the performance issue I realized I could probably figure out a solution to this problem, but it would take a while since I wasn’t an expert with the main database in the query.  Actually I realized this problem was one that would be better served by sending it over to the DBA that managed the database that I am less familiar with.  It was a little hard on my ego to let the problem pass, but in the end it was the correct decision.  The other DBA was able, in a short period of time, to rearrange the query to properly use existing indexes.  He was able to fix the performance problem in a very timely manner.  Looking at his solution I was impressed and learned a little more about how things work in that database.

This experience helped me realized that I am not always the best person for the job.  It benefited everyone involved for me to not try and solve this problem, since the problem was fixed quickly and I was able to learn something, too.  It was a good lesson for me to realize I don’t always have to be the go-to guy and sometimes somebody else is the best person for the job.  Share a time you realized you weren’t the right person for the job and how that worked out.

bkubicek

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

Redgate SQL Change Automation
 
 Featured Contents

Implementing Reporting Application Enhancements with No Downtime

Imran Quadri Syed from SQLServerCentral

The purpose of this article is to detail steps that would help implement an enhancement to reporting application that uses SQL Server Database (or any other database) in backend without causing downtime to reporting application.

SQL Server Disaster Recovery Options

Additional Articles from MSSQLTips.com

This presentation is to get you thinking about the disaster recovery options for SQL Server, things like backups, log shipping, Availability Groups, clustering and more while putting them in the context of the enterprise.

From the SQL Server Central Blogs - Replaying Workloads to a different Database

spaghettidba from SpaghettiDBA

One of the features I was asked to implement for WorkloadTools is the ability to replay commands to a database name different from the one recorded in the source...

From the SQL Server Central Blogs - Running Jupyter Notebooks as Agent Jobs

mrrobsewell from SQL DBA With A Beard

Azure Data Studio is a great tool for connecting with your data platform whether it is in Azure or on your hardware. Jupyter Notebooks are fantastic, you can have...

 

 Question of the Day

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

 

ADF Triggers

As of March 2020, if I want to execute an Azure Data Factory pipeline with a trigger, what options do I have?

Think you know the answer? Click here, and find out if you are right.

 

 

 Yesterday's Question of the Day (by BTylerWhite)

Difference Between Lists

I have the following two lists in Python:

registered_ids = [1, 2, 5, 7, 8, 9, 20, 21, 22]
recent_login_ids = [3, 5, 9, 21]

Comparing these two lists, how can I return a list of registered_ids not present in our list of recent_login_ids?

Answer: list(set(registered_ids).difference(set(recent_login_ids)))

Explanation: We can use the built-in difference() function to accomplish this. First, our lists needed to converted to sets as we aren't able to identify differences without using list comprehension. Our result will need to be converted to a list to achieve the correct answer. This is similar to R's setdiff() function and SQL's EXCEPT set operator. Since we're able to use the "-" operand working with sets, the following code would also have been a viable answer.

list(set(registered_ids) - set(recent_login_ids))

Reference: https://docs.python.org/3.9/library/stdtypes.html?highlight=difference#frozenset.difference

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
SSIS Deployment Issue - Hello: Problem:  Cannot deploy SSIS packages to AZURE VM/SQL Server Instance (or execute them via SSDT/VS) from a local laptop using a SQL Login. FYI:  Project Deployment Model is used. Background:  We moved our development SQL Server instance to an AZURE VM, and would like to avoid giving every developer RDP permissions access to the server. […]
SQL Server 2017 - Development
count by week by start/end date - I'm trying to show a count by week but I am unsure of how to find dates between years? How do I show the Year, Week, and count for the example below? This ID_NUM should show 1 for every week for the entire year. I've shown what I've tried so far below. Thanks.   I'd […]
update by quantity - I'm writing an update statement that uses a quantity column to determine how many rows get updated.  I can accomplish this using RBAR, but performance is unusable and I can't figure out how to do this as a set operation. I have a sales table that contains a row for each individual item.  In the […]
SQL Server 2016 - Administration
Convert SQL HA (2 node) to Standalone - Hi, We have some of the SQL Server AlwaysOn environment (NonPROD) where we do not require alwayson any longer. Instead a standalone system will be sufficient. Without provisioning a new environment (standalone), how we can use the existing HA to a standalone and remove one of the other nodes? Does Microsoft has any clearly defined […]
Shrinking _log file for live database - I have a live database in SQL2016 (in Production, in use) that I need to shrink its l_log file which has grown to over 250GB. Can I use this type of command block safely?: ALTER DATABASE ExampleDB SET RECOVERY SIMPLE DBCC SHRINKFILE('ExampleDB_log', 0, TRUNCATEONLY) ALTER DATABASE ExampleDB SET RECOVERY FULL
SQL Server 2016 - Development and T-SQL
Temporary turn off Transactional Replication? - Hi We get a DB that is replicated every 10 seconds or so We are having an speed issue running SP's against this database. Does anyone know of a command that I could temporary turn off Replication while the SP runs then turn it back on after the SP is completed?   Thanks     […]
Stored Proc slow after switching to Replication? - Hi First, let me apologize in advance for my ignorance on this... We are in the process of switching our reporting DB from backup and restore to transactional replication. I am testing stored procedures and noticing some SP's run much slower in transactional replication. I've done some googling and have tried the three below, but […]
Development - SQL Server 2014
Trouble with Finding Dependencies between Tables using Keys - In the past I could rely on the View Dependencies feature in SQL Server Mgt Studio to show me all objects that an Object depends on or that the object is dependent on. I don't know when this changed but it no longer works reliably.  The View Dependencies works for some parent/Child tables but not […]
SQL Server 2012 - T-SQL
Dynamic Column update. - I would like to update TASK_NXT_RUN_DT  column based on the script in column 2 dynamically. I have tried using while loop and dynamic sql but no luck. Any help on this much appreciated   create table #CFG_PROCESS_EVALUATE_TASK_MSTR ( taskid int, TASK_SCHED_SQL_SCRIPT varchar(500), TASK_LST_RUN_DT datetime, TASK_NXT_RUN_DT datetime ) insert into #CFG_PROCESS_EVALUATE_TASK_MSTR select 1,'dateadd(dd,1,TASK_NXT_RUN_DT)','2020-04-02 03:17:40.043', '2020-04-02 03:17:24.353' […]
Finding a range of date within a range of date - I have a project that requires to display a list of patients within a specific period of dates but having problems building my statement the following is the sample data set. CaseNo     DateAdmitted   DateDischarge 1                 12/01/2019        12/02/2019 2                12/01/2019         12/03/2019 3                12/02/2019        NULL                   - not yet discharge Scenario 1:  getting patients from 12/02/2019 to 12/03/2019 […]
SQL Server 2019 - Administration
Unexcpted erorrs restoring large tables - Hi Please excuse me if this is a basic question, I have been given a .sql file which has a script to create and insert data into a table. The script around 100,000 records in it. Most of the content is in the form 'Insert into table ....' 'insert into table ...' GO Insert into […]
SQL Server 2019 - Development
mass null replace in a query. - I have some data that i have no control over (third party supplying the data). I am extracting it to a CSV but the end user does not want "Null"s they want blank spaces is there a way to do a mass replace on all 36 fields. Case when isnull.... = ' ' end
before update trigger on sql server - Hi everyone, I have two tables called users and formerpasswords. In users I have two fields: name which is primary key and password. In formerpasswords I have three fields: number which is primary key, name and password. I would like to create a trigger on users table so if I insert pairs of values in […]
Integration Services
continue my package even in Failure - Good morning all , I start in ssis and I have a request that I can't find a solution I have a 3 step package (Step1 ----> Step2 ---> Step3) I'm looking to go to Step 3 regardless of the status of step 2 (succed or Failed) Who can help me please on a solution?
SQL Server Newbies
Force job to fail based on condition of IF - I am using SQL Server 2005 and I need to force a job to fail based on a condition of an IF statement. This is an overview what my code is doing: IF (SELECT '1') = 1 BEGIN PRINT 'Yes' END ELSE BEGIN PRINT 'No' END The above isn't my exact code but this gives […]
 

 

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

 

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