SQLServerCentral - www.sqlservercentral.com

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

Featured Contents

Featured Script

The Voice of the DBA

Testing Coders

Interviewing someone is hard. In fact, I'm not sure many of us really know how to do it well. Looking at the past hires in most companies I've known, I find that all too often the success of hires in developing software is a bit of a hit and miss effort. Some hires do well, and some don't quite perform as expected. Why is that? Wouldn't you expect that we could adequately test someone's skills as a developer? After all, we know what kinds of code we expect people to write. Shouldn't there be some sort of test that you could have someone complete, even across a few hours, that would allow them to show what they can produce?

I ran across an interesting post from Ore Eini that looks at a way of interviewing people by asking them to improve code. Rather than a take home test, or having someone develop code from scratch, Ore gives them a file and some code, then asks them to make it faster. The interviewee has around an hour (mentioned in the comments), but this is a test of whether or not someone understands how to read and write code well.

Perhaps there's a good way to do this in the SQL world as well. Can we take a loop or a complex join and have a user rewrite a query to be more efficient? Some of the changes in T-SQL in recent versions (especially 2012) can dramatically change the way you write code. Perhaps a candidate should be tested to see if they actually know how to avoid Grant's seven sins? I bet more than a few people would want to know if candidates would remove, or at least question, the use of NOLOCK.

There are many reasons why a candidate might interview well and then not perform as expected on a day to day basis. Life changes, we have outside distractions that might affect us at work. During the workday, we may struggle to get along with co-workers. Our managers might not bring out the best, or even the good, in us. Perhaps we are asked to perform tasks that weren't covered in an interview and are outside our area of expertise. Perhaps we just don't try as hard after we've achieved our goal of getting he job.

There isn't going to be any magic, guaranteed way of ensuring we hire people that will always perform up to their abilities. That doesn't mean we should give up. I would really like to see us continue to try new techniques, share ideas, and most of all, continue to inspire and motivate others to learn more about their craft and constantly improve their skills.

By the way, if you're interested in the code side of things, Ore discusses some basic improvements and then more efficiency changes. One interesting thing, moving away from Linq dramatically lowered the memory allocations and working set size. Is this a big deal? It really depends on the way in which your application is structured, but this is an optimization that might be worth doing early and often with a little developer training on how to better write queries.

Steve Jones from SQLServerCentral.com

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


The Voice of the DBA Podcast

Listen to the MP3 Audio ( 4.1MB) podcast or subscribe to the feed at iTunes and Libsyn. feed

The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music.

ADVERTISEMENT

Registration
is still open
for our FREE
virtual event
on December
14th and 15th.

Don't miss out!

Featured Contents

 

Downloading multiple files from internet with SSIS and C#

Daniel Calbimonte from SQLServerCentral.com

This is a tutorial to download multiple files from internet using the SSIS Script Task. More »


 

Can comments hamper stored procedure performance?

Additional Articles from SQLPerformance.com

After a recent conversation on Twitter, Aaron Bertrand shows where excessive comments in your stored procedures might have an impact on performance. More »

Question of the Day

Today's Question (by Steve Jones):

I have a two node Availabilty Group (AG) in my environment, and I need to ensure the databases are backed up while minimzing load on the primary. I want to set the backup preference for my SalesAG Availability Group to have backups occur on the secondary when it is running. What command should I run? 

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: Backup.

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

Microsoft SQL Server 2016 Reporting Services

Build, publish, and maintain paginated and mobile reports using the expert tips and best practices contained in this hands-on guide. Written by a member of the original Reporting Services development team, Microsoft SQL Server 2016 Reporting Services, Fifth Edition, fully explains the process of creating and distributing reports and shows how to maximize all of the powerful, integrated SSRS capabilities, including the new and enhanced features. 

Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

I am creating a login and see there is a CHECK_POLICY option. What does this do?

Answer: Ensures a SQL Server login's password must conform to the Windows host password complexity and expiration policies.

Explanation:

These password policies are based on the Windows host policies and apply to SQL Server logins.

Ref: Understanding Password Policy for SQL Server Logins - https://support.microsoft.com/en-us/kb/2028712

Enforce Windows PAssword Policy on SQL Server Logins - https://blogs.msdn.microsoft.com/sqlsecurity/2009/03/24/enforce-windows-password-policy-on-sql-server-logins/


» Discuss this question and answer on the forums

Featured Script

Unpivot SQL Select Data

Ted Tabah from SQLServerCentral.com


Userful in SSMS:

For evaluating a result set on a wide table - generally when filtering on a single row.

Current Restrictions:

1) does not work for XML and binary columns (perhaps others)

2) ordering  by column name not useful for multi-row result sets

Examples:

exec SP_UnPivotSelect 'select * from sys.tables where object_id=30623152', 'Y'

exec SP_UnPivotSelect 'select * from sqlver.tblSchemaManifest where ObjectName like ''%Manifest%'''

More »

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 2016 : SQL Server 2016 - Development and T-SQL

Select query inside procedure taking long time, clustered indexes doing scans, need suggestion - I have a procedure, which is running very slow, and is being timed out without returning any records. [Reports] Table...


SQL Server 2014 : Administration - SQL Server 2014

How many megabytes is 128 GB? - I'm about to max out the RAM allocation on a Standard Edition of SQL Server for the first time in...


SQL Server 2014 : Development - SQL Server 2014

SQL comma separated values and a loop - Hi I have 2 tables. A jobs Table and a Drops Table. In the Jobs table we have a collection...

Stored Procedure to transfer all DB objects including data from one schema to another schema - hi, Stored Procedure to transfer all DB objects including data from one schema to another schema this is the code i tried...

Deny DML on a table - Hi all I have a table "test" in my "testdb" database. There is a user "user1" The user has access to...


SQL Server 2012 : SQL 2012 - General

Script to replace "," - How to create a loop to go through all fields, all cells to replace "," with " " (space)? For example, there are 70...

Database design - Hi, I am having an transaction database in SQL 2012 which is under UAT, Initially there use to 10-15 insert in...


SQL Server 2012 : SQL Server 2012 - T-SQL

t-sql 2012 possible join to same table - In a t-sql 2012 column I have a column called test1 defines as (varchar(10),not null) in a table called tab....

Calculate opening hours between 2 dates - Thanks in advance. I have searched tons of sources but none seem to include weekend hours. I have a table called 'Operations'...

trying to get rid of clustered index scan - I have statement below which does a merge join but does a clustered index scan with over 2 million rows...

Unexpected Behavior With TOP clause in a DELETE - I recently encountered some unexpected behavior, or at least not expected by me, using the TOP clause in a DELETE...

effective use of subquery with a where condition - Good day friends, i have the query below: There are two sub queries with joins, the first sub query requires a...


SQL Server 2008 : SQL Server 2008 - General

Database Size After Deleting 200-million rows - Hi Guys, I've been going through a process of cleaning up extraneous data, both for compliance and as a bit of...

Weird Resource Database Message in Error Log - I'm getting this message in the error-log each time on a SQL restart. [quote] The resource database has been detected in two...


SQL Server 2008 : T-SQL (SS2K8)

Split list of string into all possible combinations - I have a table that contains one column and is populated as follows: declare @table table ( Col varchar(100) ) insert @table ( Col...


SQL Server 2008 : SQL Server Newbies

SQL Query/JOB Error - Hi all, Need advise for my error Executed as user: NT AUTHORITY\NETWORK SERVICE. Arithmetic overflow error converting IDENTITY to data type int....


Data Warehousing : Strategies and Ideas

Multiple Joins on Fact Table - Hi, I am building a DW which will load data from 2 separate sources. Each source will populate the Broker Dim table...


SQL Server 2005 : Administering

Rebuild Index Task fails - Hi Folks, The scheduled reindexing job has failed with the below error: Source: Rebuild Index Executing query "USE [Msql2d] ".: 6% complete End...


SQL Server 2005 : SQL Server 2005 Performance Tuning

Float vs Decimal? - Does anyone have any opinions concerning the performance of Float vs decimal data types? For example I have a table that...


SQL Server 2005 : T-SQL (SS2K5)

TSQL RegEx find and replace without CLR - Hi, I am having a table with a column which is having data like # followed by some number for Eg. #123. I...

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 ©2015 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: [email protected]