SQLServerCentral - www.sqlservercentral.com

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

Featured Contents

The Voice of the DBA

Common Mistakes

This editorial was originally published on Mar 20, 2014. It is being re-published as Steve is out of town.

At times I am rather dismayed by the quality of code I see written today. I'm not sure it's worse than the poor code compiled early in my career, but there are so many more people writing code in our industry that it seems there is more and more poorly written code.

We suffer from the chef problem in techology. As more companies look to become software companies, they need to hire more software people. To meet the staffing demand, more and more marginally skilled people will be chosen, and software quality goes down.

Part of what we do here is to try and educate the SQL Server professionals on how to become better at their jobs. That's really the core mission that started SQLServerCentral and continues today thanks to the belief in that mission by Red Gate Software. As we look to do that, we want to bring to light the things that aren't good ideas and can cause problems.

What common mistakes do you see T-SQL developers making?

The question this week is based on a post by the talented Doug Lane, who wrote about the top three mistakes T-SQL developers make. Doug has a good list, and I'd urge you to read it, along with some sage advice from Brad McGeHee. However I'm sure many of you see different common issues in your own work.

What things need to be fixed later? What code regularly causes performance issues? The more specific problems that you can share, along with their solutions, the more you might help another developer build better code in the future.

Steve Jones from SQLServerCentral.com

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

ADVERTISEMENT
SQL Prompt

Become a more efficient SQL developer with SQL Prompt

Learn how to write SQL faster and more efficiently with these exclusive short videos from Data Platform MVPs and SQL Server experts. With SQL Prompt you can strip out the repetition of coding and write SQL 50% faster. Check out the tips

GDPR

How to make your SQL Server development GDPR ready

Redgate’s SQL Data Privacy Suite helps you to build a data catalog of your SQL Server estate, and put in processes to protect and monitor personal information. Find out more about how our tools help with GDPR compliance

Featured Contents

 

SQL Server Restart or Cluster Failover Notification

Lori Brown from SQLServerCentral.com

How to create an automatic SQL restart or failover notification. More »


 

In-Memory OLTP – Common Workload Patterns and Migration Considerations

Additional Articles from Microsoft MSDN

In-Memory OLTP is a high performance, memory-optimized engine integrated into SQL Server 2014 and designed for modern hardware trends. In-Memory OLTP allows users to move data into memory resident tables while keeping other data in traditional, disk-based table structures. For performance critical workloads, users can also migrate Transact-SQL code to natively compiled stored procedures. This can provide additional performance gains. This paper aims to help readers understand some of the common architectural patterns where In-Memory OLTP has provided significant benefits. The paper also discusses considerations for migrating applications to In-Memory OLTP. More »


 

Demoing Latch Waits with Stupid Tricks

Additional Articles from Brent Ozar Unlimited Blog

Stuffing table variables with hard-coded values to demonstrate concurrency. More »


 

From the SQLServerCentral Blogs - Analyzing Feedback From Music City Tech 2018

Angela Henry from SQLServerCentral Blogs

I recently presented two sessions at Music City Tech and just received my feedback.  I got great feedback and looks... More »


 

From the SQLServerCentral Blogs - Moving to Azure: A change in processes – TSQL Tuesday 103

Kenneth Fisher from SQLServerCentral Blogs

For this month’s t-sql Tuesday our host Bjoern Peters (b/t) wants us to describe our experiences with Azure SQL Database... More »

Question of the Day

Today's Question (by Junior Galvão - MVP):

After executing the Transact-SQL code block declared below in Microsoft Managenent Studio 17.7, what happens?
 Use TempDB Go Declare @MyVariableNumeric1 Numeric(6,2), @MyVariableNumeric2 Numeric(2,2) Set @MyVariableNumeric1 = 100.2 Set @MyVariableNumeric2 = 2 Select @MyVariableNumeric1 As 'Value 1', @MyVariableNumeric2 As 'Value 2' Go

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 1 point in this category: Arithmetic.

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

This comprehensive and authoritative guide will teach you the DAX language for business intelligence, data modeling, and analytics. Leading Microsoft BI consultants Marco Russo and Alberto Ferrari help you master everything from table functions through advanced code and model optimization

Pick up your copy of this great book today at Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Henrico Bekker):

When executing a SSIS package in Azure Data Factory, the package requires conversion or execution in 64bit.

Answer: False

Explanation:

32-bit execution is supported in ADF Pipeline using SSIS Packages.

Ref: Run an SSIS package with the Execute SSIS Package Activity in Azure Data Factory - 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

How to find the all table list in the order of reference - Hi, How to find the entire table list in the order of Foreign  key reference in a database ie. Parent table first,...


SQL Server 2017 : SQL Server 2017 - Development

Get first date and last date of the current month base on Work Week - Hello all, Thanks in advance for any assistance you can give me.  What I am trying to get is the first date...

Lock on SQL data rows - Hi, Can some one please help how can I acquire lock on rows while it is being worked by some one. My...

Conversion failed when converting the nvarchar value '/' to data type int. - I have SQL query as following : SELECT   TOP (99.9999999) PERCENT CAST(CAST(LEFT(SpecialCode, CHARINDEX('/', SpecialCode) - 1) AS nvarchar) AS int) AS...

Error Processing Cube from SSIS package run as a SQL Job - Hi, I am trying to upgrade a SQL server with Analysis Services to SQL 2017 cu5, 14.0.3023.8, (I tried CU4 before...


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

Looking for some thoughts on design for db table renaming. - Basically, we have a 2 tables. One is being used by the app for querying (active), and one is used...


SQL Server 2014 : Administration - SQL Server 2014

Linked servers on an instance all pointing to the local instance. - We have around 4 linked servers on an instance, each one of them pointing to a remote instance. These were...

Excessive Paging Continues... - We've been experiencing "excessive paging" for a while (per perfmon review).  Application is sluggish. Added memory to the server (virtual machine), there's...


SQL Server 2014 : Development - SQL Server 2014

Violation of Primary Key Contraint - Hello, I am getting this error when executing my statement: Msg 2627, Level 14, State 1, Procedure ad_MissingStudentMasterData_Enrolled, Line 89 Violation of PRIMARY

General query intended to be Stored Prodedure using optional parameters - I intend to make a stored procedure that accepts several parameters and that has an option not to accept any...

SSIS data truncation. - I have a csv file which I am processing through SSIS. But there are companies in the list which have...


SQL Server 2012 : SQL 2012 - General

Logging options while running stored procedure - Hi I am tasked with building a stored procedure which performs inserts, merges, etc. What i have now is as follows. create...


SQL Server 2012 : SQL Server 2012 - T-SQL

Generate XML with name/value pair using FOR XML - Greetings, We have a vendor that is requiring that the XML we send them has name value pairs at the deepest...


SQL Server 2008 : SQL Server 2008 - General

Update Statistics script - I am looking for a script where I can update the statistics of the objects in a database if only...

Transactional Replication :: Error Creating New Publication - Attempting to create a new publication and received this error: TITLE: New Publication Wizard ------------------------------ SQL Server could not create publication 'XX_TABLES'. ------------------------------ ADDITIONAL INFORMATION: An...

SQL Server Agent can't start - Hello, I have these messages while trying to start the Agent. Knowing that a day before, it worked without any problems...


SQL Server 2008 : T-SQL (SS2K8)

Any better way of querying multiple tables based on a column value? - Hi all,I often have situations where I have a table which stores, in two separate columns, a value and a...

Clustered PK perf - - Hi Experts, I have a doubt reg. the creation of a clustered PK for one of our DWH tables. Background - There's a...

ROW_NUMBER() OVER (PARTITION BY *** ORDER BY ***) excluding NULL values - Does anyone have an idea how to tweak the TSQL above to exclude assigning a row_number to rows for a...


SQL Server 2008 : SQL Server Newbies

Transpose a particular row to columns - I am seeing lot of examples of PIVOT to do this, but my problem is different. I have a table like...

This email has been sent to [email protected]. To be removed from this list, please click here.
If you have any problems leaving the list, please contact the [email protected].
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 ©2018 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: [email protected]