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

Daily Coping Tip

Get moving. Do something physically active (ideally outdoors)

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.

Allowing Failure

Today we have a guest editorial as Steve is on vacation.

I was reading a forum post from Jeff Moden on allowing people to fail. I thought he made some good points and wanted to probe this topic further.

For those of you that have children, I think allowing them to fail is one of the hardest things you can experience in life. Often we don’t allow it. We change the situation or the rules so our children don’t experience failure. Yet, we and they can learn things from failure. Good things, that can help us in the future if we let them.

It can be similar at work. We have projects, people, systems we have invested our lives in. They are sometimes, kind of like our baby. We don’t want to see them fail. I am not suggesting we should allow major systems to fail or allow data corruption on a production server. Still, sometimes people do make choices that in our opinion are not wise and will not work. In some cases, the best thing to do might be to allow things to take their natural course, which may lead to failure.

So why can failure be a good thing? In the case of our children, it gives them a chance to build up their determination and try again. Success can be so much more sweet when you failed the first time around. It is important to learn from our mistakes. To heed advice, and perhaps listen better when someone suggests we are making a bad decision.

It can be similar at work. Sometimes you just have to try something before you realize it isn’t a good idea. Nobody likes to be told, “I told you so,” but they might listen to you in the future if you communicate yourself in a positive way. A failure event may be the only thing that changes the direction management is trying to lead you.

I believe it is also important to allow ourselves to fail. To take risks with new or old technology, to try new things. It doesn’t mean they need to be released to production, but if we don’t risk failure we can miss out on great gains by not dreaming and reaching for something more.

I hope the next time you are in a meeting and you are sure this new idea or plan is doomed to failure, that you pause. That you consider if allowing failure is a good choice in this situation. Perhaps like Jeff’s situation, you will be proven right and you will get new hardware out of the deal. Share a time you allowed someone or something to fail and share how it ended up.

bkubicek

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

 
 Featured Contents

Mathematicians and SQL

Joe Celko from SQLServerCentral

Georg Ferdinand Ludwig Philipp Cantor is considered the creator of set theory, and his theories are the basis for the naïve set theory you learned in school. But there are lots of other mathematicians you should know, such as Hilbert, Frege, Russell, Zermelo and Dedekind. They made a lot of contributions, too. Hilbert Hilbert is […]

Ten Reasons your SQL Server Monitoring will Scale

Additional Articles from Redgate

This article explains ten ways that SQL Monitor tackles the problem of scaling out the coverage of a single, lightweight monitoring system, and so allows your teams to maintain the health and performance of larger collections of databases and higher numbers of monitored SQL servers.

DAX financial functions: Depreciation calculations

Additional Articles from SimpleTalk

Business Intelligence Architect, Analysis Services Maestro, and author Bill Pearson continues his series surrounding the DAX financial functions. In this article, he exposes four functions that are popular in the calculation of depreciation and amortization. Those accustomed to these functions within Excel will find the syntax, uses and operation of the functions familiar within the Power BI environment.

From the SQL Server Central Blogs - Power BI: Data Model Optimization

Steve Hughes from DataOnWheels

Saving the Day from Delay Part 1 Optimizing your data model can be a daunting task. If you read the intro to this series, you know one of the...

From the SQL Server Central Blogs - T-SQL query to find the list of objects referring Linked Servers

Brahmanand Shukla from SQL Server Carpenter

T-SQL query to find the list of objects referring Linked Servers

 

 Question of the Day

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

 

The Time Zone Range

I've got a variable that I declare like this on SQL Server 2019:
declare @date datetime2
I need to assign this value from a string that looks like this: '2020-01-10 16:00:00 -07:00' When I do this, I am concerned that I might lose the time zone value. What value is @date assigned?  

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)

Re-OPENing a Cursor

I have this data:

RSSFeedID   FeedName
----------- -----------------------------------
1           SQL Server
2           .NET
3           Azure SQL Database
12          Azure SQL Data Warehouse

I now run this code:

DECLARE mycurs CURSOR FOR
SELECT rf.RSSFeedID, rf.FeedName FROM dbo.RSSFeeds AS rf ORDER BY rf.RSSFeedID;
DECLARE
    @id INT
  , @feed VARCHAR(50);
OPEN mycurs;
FETCH NEXT FROM mycurs
INTO
    @id
  , @feed;
FETCH NEXT FROM mycurs
INTO
    @id
  , @feed;
SELECT @id, @feed;
CLOSE mycurs;
OPEN mycurs;
FETCH NEXT FROM mycurs
INTO
    @id
  , @feed;
SELECT @id, @feed;
CLOSE mycurs;
DEALLOCATE mycurs;

What ID is returned by the last (third) SELECT?

Answer: 1

Explanation: When you close a cursor, the resources and locks are released. When you open the cursor again, the command repopulates the cursor with the SELECT used in the definition. Ref:

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
Exchange Event in SQL Profiler - Hi all. I received a Deadlock Graph and saw that I have Exchange Event in it. I read that it means the problem with parallelism. I have such a query: SELECT * FROM TABLE Account WHERE ID NOT INT (SELECT * FROM TABLE Account WHERE ...) Could this be the reason in the subqueries and […]
Performance - I am assisting with a migration. doing a V to V migration from a legacy environment to the hosted infrastructure. I want to do some baseline testing and wondered if there are some scripts i could run in SQL that i could run on the legacy and on the new environment to compare so I […]
SQL Server 2017 - Development
xp_cmdshell - System Cannot Find the Path Specified - Dear Group: This is my first attempt at using the xp_cmdshell command, but right now, I am trying to run it inside SSMS.  We need to create a procedure to unzip files so that we can import the data into our tables.  I am trying to use PKWare SecureZip to do this, as I have […]
SQL Server 2016 - Administration
High CPU and plan cache instability - In the past couple of months my SQL Server instance has been experiencing higher than usual CPU usage than before, at times hitting 100% and affecting an application. There have been no recent changes to any SQL Server configurations or options in that time, the OS may have in terms of Patching but that is […]
Statistics issues - Hi All, Looking for some clarifications on UPDATING STATISTICS. In our production env, we have 3 TB database with Auto_create stats option is set to true. Every weekend on Saturday midnight we run update stats with full scan. However, during the mid of the week, application developers keep complaining that few queries are running slow. […]
SQL Server 2016 - Development and T-SQL
Table Elimination In a View - I'm experiencing a situation similar to the overly simplified example provided here CREATE TABLE dbo.Sales ( DateKey INT ,Quantity INT ) INSERT INTO dbo.Sales VALUES ( 20210101 ,5 ) ,( 20210102 ,15 ) ,( 20210103 ,4 ) ,( 20210104 ,8 ) ,( 20210105 ,23 ) ,( 20210106 ,47 ) ,( 20210107 ,31 ) ,( 20210108 […]
Import JSON in SSIS with Column Row Transformed - I’m attempting to modify the code on this SQL Server Central article "Approaches to Import JSON in SSIS (SQL Server 2016+) Part 2" using the methods described under “Using SQL Functionality”. I'm successfully using this with other JSON files formatted in a more standard way. However, the JSON flat file that I’m tasked with bringing […]
Update large table rows within a group - I have a large employee table with lots of columns and versions and one org lookup table also with some versions. I need to update a column org_id in employee table  which is all nulls now with no history. An employee can have multiple versions records each with same empid but same or different rc_code. […]
CAST(NULL AS varchar(1)) - Hello All, I have been tasked to improve a very old SQL code we have and first thing I see (may not necessarily be the candidate for performance improvement though) going through the code is many CASE records with CASE WHEN myColumn IS NULL THEN CAST(NULL AS varchar(1)) .... Can one advise why someone would […]
Development - SQL Server 2014
Tuning Complex Procedures - Hello, I was wondering if anyone has written something like this.  Basically I am trying to tune some stored procedures and I am looking for a stored procedure or tool that would allow me to run a problematic stored procedure a specified number of iterations and then aggregate results like CPU, Reads, Writes, Etc to […]
SQL Server 2019 - Administration
SSIS jobs - we are actually not using a file logger for our SSIS jobs, the logging is done to the database. File logging is in addition, I was thinking to log them on the same server instead of shared location. Do you see any issues?  
SQL Permissions - My understanding is you can't grant access to users with select, View database and view definitions etc. at instance level without any user databases created on it. Please advise?
authgrowth log during rebuil index - Good morning all , Have any idea how I can reduce disk consumption during the reindexing phase I use the IndexOptimize procedure of the olla script  
SQL Server 2019 - Development
Better way to flatten meta type data? - I have the following table how would I be able to get a view similar to SELECT [ID], [NAME], [Imaging], [Long Term], [Auto], [Factory], [Central Office], [Pizza] FROM [Some SQL Magic Code]; The best I've come up with is multiple selects with where clauses to create tables and then join all of them.  I'm not […]
Analysis Services
SSAS Tabular SSDT DAX Drillthrough Issue - Hello, I've come across a scenario where the drillthrough functionality is not working when multiple dates from a fact table is joined to a single date dimension. If I have a fact table with multiple status dates e.g. Resolved Date, Logged Date and join it to one Date dimension table, one of the relationship would […]
 

 

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

 

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