In this issue

Featured Contents


Featured Script

It's better to wait for a productive programmer to become available than it is to wait for the first available programmer to become productive. -- Steve McConnell

SQL Backup Pro Are you sure you can restore your backups?
Run full restore + DBCC CHECKDB quickly and easily with SQL Backup Pro's new automated verification. Check for corruption and prepare for when disaster strikes. Try it now.
SQL Connect Keep your database and application development in sync
SQL Connect is a Visual Studio add-in that brings your databases into your solution. It then makes it easy to keep your database in sync, and commit to your existing source control system. Find out more.
SQL Storage Compress Compress live data by 73% 
Red Gate's SQL Storage Compress reduces the size of live SQL Server databases, saving you disk space and storage costs. Learn more.

In This Issue

Fun with Outer Joins

Learn how an outer join works and how you can use it in your applications to find the results you need when matching data isn't in all your tables. More »

Meredith Ryan Chosen as the Exceptional DBA of 2012

Congratulations to Meredith Ryan for being chosen the Exceptional DBA of 2012. More »

SQLskills training goes online worldwide (and free in September!)

SQLskills is recording their knowledge in conjunction with Pluralsight for you to view from the time and place of your choosing. And it's free in September. Read more to find out how you can get access. More »

SQL Saturday #155 - Lima

SQL Saturday is exploding in South America, and Lima hosts it's event on Sept 22, 2012. Come join fellow data professionals and learn about SQL Server. More »

Gail Shaw's SQL Server Howlers

For the latest in our series of SQL Server Howlers, we asked Gail Shaw which common SQL Server mistakes and misunderstandings lead to tearful DBAs and plaintive cries for help on the forums. More »

From the SQLServerCentral Blogs - Demystifying SQL Server Differential Database Backups

Odd Man Out SQL Server has three backup types. Two you have heard of and used. One, while useful, isn’t very well understood. Let’s... More »

Editorial - A Cloudy Future

Those of us in Information Technology are constantly learning to do more with the tools and platforms we have. There are no shortages of new systems to manage. Since staffing levels never increase as quickly as servers, we must find ways to manage and maintain more and more systems all the time. That's fine since tools like Powershell or MultiScript allow us to extend our reach to many machines as easily as we work with one machine. That's not quite accurate since the effort to build a repeatable process is greater than performing a task one time, however I have found that most of the time if I need to perform a process once, I'll need to do it again.

Over time I've learned that investing in my own skills, and learning to work smarter and more efficiently, has paid dividends for me. Becoming more familiar with the business my employer is involved in has helped me to return more value to the company, as well as ensure that my employment is appreciated. As companies look to virtualize systems, move to cloud services, or find some other more efficient way of dealing with computing resources, it's up to each of us to find new ways that we can provide value. That's what system administrators need to do, and I suspect DBAs need to be thinking along these lines as well.

The world is getting more complex from an IT perspective. These days companies have their pick of candidates for many jobs, and the person that has a variety of skills in multiple areas with a history of solving problems is desirable. Even when companies have few candidates, they seem to be waiting to hire a candidate that is a good fit rather than picking the first person they find if that person lacks some of the skills the company needs.

As you continue along the path of your professional development, think about adding a variety of skills in different areas, skills that improve your efficiency, and allow the business to get more of their work done every day.

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

The Voice of the DBA Podcasts

We publish three versions of the podcast each day for you to enjoy.

Everyday Jones

The podcast feeds are available at Comments are definitely appreciated and wanted, and you can get feeds from there. Overall RSS Feed: or now on iTunes!

Today's podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. Support this great duo at

You can also follow Steve Jones on Twitter:

» To submit an article, rant or editorial, log in to the Contribution Center

Question of the Day

Today's Question:

What is the output of both the queries?

CREATE TABLE dbo.Zip_code
    id    VARCHAR (10) NULL,
    Descr VARCHAR (max) NULL

INSERT INTO dbo.Zip_code (id, Descr)
VALUES ('1111', 'AAAA')
INSERT INTO dbo.Zip_code (id, Descr)
VALUES ('2222 ', 'bbbb')
INSERT INTO dbo.Zip_code (id, Descr)
VALUES ('aaaa', 'bbbb')
SELECT count(*) FROM zip_code WHERE id = '1111'
SELECT count(*) FROM zip_code WHERE id = 1111

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

This question is worth 1 point in this category: T-SQL. We keep track of your score to give you bragging rights against your peers.

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

Training Kit (Exam 70-461): Querying Microsoft SQL Server 2012

Ace your preparation for Microsoft® Certification Exam 70-461 with this 2-in-1 Training Kit from Microsoft Press®. Work at your own pace through a series of lessons and practical exercises, and then assess your skills with practice tests on CD—featuring multiple, customizable testing options.

Maximize your performance on the exam by learning how to:

  • Create database objects
  • Work with data
  • Modify data
  • Troubleshoot and optimize queries

You also get an exam discount voucher—making this book an exceptional value and a great career investment.

Yesterday's Question of the Day

If I run the following script how many rows will be in GoTest?

CREATE TABLE GoTest (Id INT IDENTITY(1,1), MyText varchar(20))
GO 5

Answer: 32

Explanation: If a positive integer is placed at the end of the batch separator command ("GO") then the batch is run that many times. A batch is the code executed between batch separators if any.

Ref: GO -

» Discuss this question and answer on the forums

SQL Server 2012 Query Performance Tuning

SQL Server 2012 Query Performance Tuning leads you through understanding the causes of poor performance, how to identify them, and how to fix them. You’ll learn to be proactive in establishing performance baselines using tools like Performance Monitor and Extended Events. You’ll learn to recognize bottlenecks and defuse them before the phone rings. You’ll learn some quick solutions too, but emphasis is on designing for performance and getting it right, and upon heading off trouble before it occurs. Delight your users. Silence that ringing phone. Put the principles and lessons from SQL Server 2012 Query Performance Tuning into practice today.

Get your copy from Amazon today.

Featured Script

ASCII Character Groups in String

Powerful function to find strings containing or excluding classes of ASCII characters. 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 2005 : SQL Server 2005 Strategies

Multiple parameters for a query - I receive a flat file which I am importing with SSIS. The problem is the file does not contain a...

SQL Server 2005 : SQL Server 2005 Performance Tuning

Missed hostnames and logins in SQL Auditing - We are running SQL Auditing which captures hostname, login ids,applicationname, servername etc. Today we found some activities captured but hostname...

SQL Server 2005 : T-SQL (SS2K5)

Unable to login users - It is an 8 years project.I am working on this project since 1 year.ther is a stored procedure to verifiy...

Tricky REPLACE problem - I've been poring over how to handle this for a few hours without using some kind of horrifying loop, and...

sql server Data Matrix. - I have Table A , and table B . table A holds the about the class of a product and table B...

SQL Server 7,2000 : General

send email from sql - hi how to send email from sql without using mail sql in sql server 2008?

SQL Server 2008 : SQL Server 2008 - General

SQL 2008 express DB Mail - I have SQL 2008 Express installed and running under windows 2008, with smtp service running as well. The mail could not...

image insert into SQL DB - Hi, What I have to do is creating a SQL image DB but instead of inserting the images themselves into it...

The index may be corrupt. Run DBCC CHECKTABLE to verify consistency. - restored database from SQL2000 to SQL 200R2 After restore I got bunch message in the logs. Any idea? what is fix? Or...

SSIS runs in debug but not from job - We have this SSIS where one of its components, reading a flat file and writing to a database table, runs...

Indexing??? Help Needed - Hey guys, i really need some help here since i am a very new programmer, so i thank you in...

Multiple columns search with some blank/null values - Hi, I have a Form of multiple fields and there are some fields that are optional. How I can perform that...

Update Statistics - Hi every body Updating statistics causes queries to recompile. first time that i run a query with a parameter,the query optimizer make...

SQL Server 2008 Standard Installation failed - SQL server 2008....stand alone. Windows 2008 r2 SP1 I have been trying to install a SQL server default instance basically through out...

SQL Agent job errors: 665 File limitation - Environment: 64 bit version of SQL Server 2008 R2 Issue: When I tried to run a job which pulls about...

Move extents between files - Hello, i would like someone to help me in this I have a filegroup A with file A1 and A2 file A1...

Passing comma separated values for IN list in DELETE statement from SQLCMD - Hello, Following are the contents of script Delete_employees.sql. [quote]USE CompanyDB BEGIN TRAN DELETE FROM dbo.employee WHERE empid IN ([b]<Comma separated values passed from SQLCMD>[/b]) COMMIT TRAN;[/quote] [b][u]Question:[/u][/b] Will...

Weird Requirement... Multiple Left Joins? Am I missing something? - Ok, so I think I should know the answer to this but I'm getting nothing but what looks like a...

Insert Into temp table and then copy into 'real' table - Hi Chaps I have a stored procedure which is scheduled to run hourly - this stored procedure deletes all rows from an...

SQL Server 2008 : T-SQL (SS2K8)

Looping through table - Hi, I have to write a query and i am not sure how to go about it. I have a table...

Fetching values under condition - Hi to all I have a Query which is fix like SELECT StudentId,EnrolmentId,SessionId,SchoolId, Name, ClassGroupId, ClassId, ClassName FROM ViewStudentTable WHERE IsBlock...

Odd SQL conversion error "August 2012" - This is a really odd issue!! A parameterised SP runs fine on my test database wth a certain set of input...

Help Needed - Hi, we are having one table (AA) with 3 columns Id,Polcinumber,date 1,s1234,04/09/2012 2,s2345,05/06/2012 we are having another table(BB) having 2 cloumns Id,Policynumber,date 1,s71234, currentdate we are inserting...

Subtracting Value - I have 2 queries as[code="sql"]select id,sum(a)/count(id) as e from table1 group by id[/code] and another query as [code="sql"]select id,sum(b)/count(id) as...

Finding a table with date appended to it and check for the range of that date - Hi All, I need to create a process that looks for a table in database with date(YYYYMM) appeneded to it where...

UPDATE when the values are the same - Does an UPDATE query overwrite existing values if the already existing value is the same as the one your updating...

SQL Server 2008 : SQL Server Newbies

Logshipping is not working. - Hi, We have a log-shipping set up on the production server for reporting purpose. Unknowingly, I have set up a backup strategy...

SQL Server 2008 : Security (SS2K8)

Create objects only in one schema - Hi All, The issue is I have to give permisions to a user just to create objects in only one schema...

Not View Any DB Other than The One He Has Access - Hi All, My req is that I have to give a user permission to view only the DB he is a...

SQL Server 2008 : SQL Server 2008 High Availability

Would a smaller number of VLFs in the log speed up the redo phase of recovery of a mirror snapshot? - From time to time, when an intensive log operation takes place on the principal database, we observe very long snapshot...

SQL Server 2008 : SQL Server 2008 Administration

SQL Server Audit - I have a requirement 1. when a user logon I would need to log the below information in a table....

Single user mode during upgrade to SQL 2008? - IN place method for the database upgrade SQL 2000 to 2008, Can I go for below one of the steps? first database...

Programming : XML

how to get the node names as well as node values from xml in sqlserver - i have an XML like:- <XML> <Provider> <providerID>1</providerID> <Address>address1</Address> </Provider> <Provider> <providerID>2</providerID> <Address>address2</Address> </Provider> here i know the node names .So i could get... : Anything that is NOT about SQL!

Are the posted questions getting worse? - Is it me, or are the posted questions getting worse these days? I just read a post by someone apparently in...