SQLServerCentral - www.sqlservercentral.com

A community of more than 1,600,000 database professionals and growing

Featured Contents

The Voice of the DBA

The Worst Code

This editorial was originally published on Mar 15, 2015. It is being republished as Steve is on holiday.

This piece was written awhile ago by Jeff Atwood, but I saw a mention about it recently. It's about software developers hating software. It's a fun piece, and written a bit tongue-in-cheek, though with a lot of truth in there. Certainly lots of the "bundled software" that come with gadgets is unnecessary and poorly tested. That's sad, as there is the chance to add value to products if the software is well written, and perhaps, open sourced.

However the thing that caught my eye was the ending. Mr. Atwood says that if a developer in an interview doesn't say the worst code they've seen lately is their own, then they may not be a competent developer. I hope that part is also a joke, and I suspect it is. Though I also think that it's a healthy attitude for people to see room for improvement in most of their endeavors.

No matter what type of task you are performing, and certainly programming is an area many of us focus, complacency is a poor way to approach your work. We know we won't be perfect, we know we'll make mistakes, we know there's room for improvement, and we know we NEED TO GET THE PROJECT DONE. The balance we strike in moving forward should be accomplishing tasks, learning what we did right and wrong, doing more of the former (and less of the latter) in the future, all while taking pride in the work we do well. 

Certainly some people are obsessive and perfectionists. There's probably another few choice words some of you have for those individuals, but most of us need to balance our desire to build something amazing, with the necessity of completing work. We also need those little wins that come from having our endeavors solve problems, even if we'd build software better the next time. The important thing is that you try to do better the next time.

Steve Jones from SQLServerCentral.com

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

ADVERTISEMENT
Redgate Hub

Watch SQL in the City Streamed 2017

The livestream recording for Redgate's 2017 virtual event is now available. Technical sessions went into the latest Microsoft SQL Server releases, and covered topical issues such as DevOps, data compliance, protection & privacy. Watch the recording

SQL Monitor

Don’t just fix SQL Server problems, prevent them from happening

SQL Monitor helps teams looking after SQL Server be more proactive. Not only does SQL Monitor alert you to current issues, it gives you the information you need to stop them happening in the future. Download SQL Monitor now and get a 14 day free trial

Featured Contents

 

Azure DWH part 21: Using Excel in ASDWH

Daniel Calbimonte from SQLServerCentral.com

This time we will show how to access to Azure SQL Data Warehouse using Excel. More »


 

Understanding Migration from SQL Server to SQL Server 2017 using Data Migration Assistant

Additional Articles from Database Journal

You can use the Data Migration Assistant (DMA) tool to migrate your SQL Server instance to an on-premise SQL Server 2017 or to Azure SQL Database. DMA analyzes data migration issues and provides recommendations to resolve them. Read on learn about the features of DMA and how DMA eases your SQL Server instance migration as well as reduces overall risks, allowing you to complete the migration successfully. More »


 

5 tips for achieving continuous delivery

If you’re struggling to set up a reliable, repeatable release process you’re not alone. The good news is that most of the problems you’ll encounter have been solved before. More »


 

From the SQLServerCentral Blogs - How to Update @@SERVERNAME to Actual Machine Name?

eitan 35333 from SQLServerCentral Blogs

The @@SERVERNAME Global Variable The system global variable @@SERVERNAMEcan be used to return the name of the machine the SQL Server... More »


 

From the SQLServerCentral Blogs - Moving to an Azure SQL Database via Command Line

Arun Sirpal from SQLServerCentral Blogs

I have moved many databases to Azure via different methods but I recently came across a new way. Well technically... More »

Question of the Day

Today's Question (by Thomas Franz):

What will be the result of the following statements (especially from the EXEC) when run on the current version of SQL 2014 or 2016:

 USE tempdb go CREATE PROCEDURE dbo.test AS BEGIN     SELECT *       INTO #tmp       FROM (VALUES (1, 1)) t(id, typ)     ;     SELECT id, typ  FROM #tmp; END GO CREATE TABLE #tmp (id INT) INSERT INTO #tmp (id) VALUES (0) GO EXEC dbo.test -- Cleanup DROP TABLE #tmp DROP PROCEDURE dbo.test 

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


We keep track of your score to give you bragging rights against your peers.
This question is worth 2 points in this category: Procedure.

We'd love to give you credit for your own question and answer.
To submit a QOTD, simply log in to the Contribution Center.

ADVERTISEMENT

Expert Scripting and Automation for SQL Server DBAs

Automate your workload and manage more databases and instances with greater ease and efficiency by combining metadata-driven automation with powerful tools like PowerShell and SQL Server Agent. Automate your new instance-builds and use monitoring to drive ongoing automation, with the help of an inventory database and a management data warehouse. Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

I have created a new SQL Server 2017 database, in which I want to enable automatic tuning with this code:

 ALTER DATABASE TheNextFacebook SET AUTOMATIC_TUNING ( FORCE_LAST_GOOD_PLAN = ON ); 

Before I do that, what do I need to turn on in the database?

Answer: Query Store must be enabled

Explanation:

Before the automatic tuning features for plan correction can be enabled, Query Store must be enabled.

Ref: Automatic Plan Correction - http://www.sqlservercentral.com/articles/Automatic+Plan+Correction/164002/

Automatic Tuning - click here


» 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 : SQL Server 2017 - Administration

Antivirus Exceptions - Yes or No? - Hi Folks, I heard an interesting conversation today about whether or not Antivirus Scanning exceptions (in this case provided by McAfee)...


SQL Server 2017 : SQL Server 2017 - Development

Help with aggregate function - have table: col1 col2 col3 A       B    10 B       A     5 C       D    8 Want to get: A    B   15 C    D    8


SQL Server 2016 : SQL Server 2016 - Administration

Issue with agent job while taking backup - EXEC msdb.dbo.sp_send_dbmail @profile_name ='DBA', @recipients ='arvindinfa2014@gmail.com', @subject = 'Differential Backup Report', @execute_query_database = 'master', @query='EXECUTE .', @body_format='html', @body='Differential Backup of USER Databases taken successfully on Server1', @exclude_query_output=1, @append_query_erro

Grant execute to procedures doing SELECT only - Hi, Our staff members all have only db_datareader permissions and View definition on all production databases. But many times they require to...

FCI + Always On - Hi, I want to setup a 3 nodes solutions. NODE_A, NODE_B and NODE_C are part of the same WSFC. Node_A -> Contains...

Multiple AG groups in one Windows failover cluster? - In an organisation I found the following setup:  Six VMs SQL1 to SQL6 in the same domain, each host two instances....

Newbie point-in-time restore question - Hello experts, I have the following scenario and am wondering if someone can confirm the steps for me. I know how to...


SQL Server 2016 : SQL Server 2016 - Development and T-SQL

C# String treatment - Hello, I have a line of code like: Filenameonly2 = line I get a result like: When I do messagebox.show  ( Filenameonly2 ) I get: 16 DIVIDENDS...


SQL Server 2014 : Administration - SQL Server 2014

Creating databse backups automatically in specific period of time - Hi Guys, I am creating back ups of my database using code: USE QlikView; GO BACKUP DATABASE QlikView TO DISK = 'C:\Program...


SQL Server 2014 : Development - SQL Server 2014

To Index a Computed Column... - Hi All, So in an effort to optimize a larger query (which I've posted about here before), I'm trying to utilize computed...

Issues with matching pattern using LIKE - Why in God's name does this not work? expecting "dateFirst": DECLARE @searchString


SQL Server 2012 : SQL 2012 - General

SQL 2012 - Interview Questions (Sample) - Hi Guyz, Warm greetings ! I'm very happy to post some interview questions today which I'd faced recently via a Skype. Could you please...


SQL Server 2012 : SQL Server 2012 - T-SQL

Selectivity vs SARGAbility? - Hi All, What is the difference between Selectivity and SARGAbility? Thanks, Sam

Using the Key Lookup and Index Seek Properties to construct the missing indexes - I was just wondering about the 'math' behind using the properties of the Key Lookup and Index seek operators to...


SQL Server 2008 : SQL Server 2008 - General

bcp changing high ascii values - bcp appears to be changing some high ascii values on import (eg 249 to 168). How can I control/prevent this...

Replace TABLE with STAGING_TABLE. Approach? - I have a Stored Procedure which does some ETL "stuff" At the end of the procedure I want to replace a...


SQL Server 2008 : T-SQL (SS2K8)

Is there any obvious performance difference between updating 1 column in a 4 column wide table vs 1 columns in a 1000 column wide table ? - I have a table with 4 columns and 10 million rows in which I want to update 1 column I have...


SQL Server 2008 : SQL Server Newbies

Stupid Question: Return Object Explorer to It's original position - Stupid question but I accidentally moved object explorer from it's original default position on SSMS. By default, object explorer is...


Reporting Services : Reporting Services

dynamic billing cycle - Hi, We have a parameter which shows dynamically the billing cycle in the report, our billing cycle is from 21th this...


SQL Server 2005 : Administering

Database in Recovery Pending State - One of my databases is in Recovery pending state. I tried to run an Alter command on the database to...

This email has been sent to newsletter@newslettercollector.com. 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.
Feel free to forward this to any colleagues that you think might be interested.
If you have received this email from a colleague, you can register to receive it here.
This transmission is ©2017 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com