In this issue

Featured Contents


Featured Script

Deployment Manager logo NEW! Automate your .NET deployments
Deploy ASP.NET applications and SQL Server changes fast, frequently, and without fuss, using Deployment Manager, the new tool from Red Gate. Try it now.
SQL Monitor logo "It's the freaking iPhone of SQL monitoring"
"Everyone just gets it… that has tremendous value" - Rob Sullivan, DBA, IdeasRun. Get started with SQL Monitor today - download a free trial.
SQL Compare A simple way to deploy databases
SQL Compare helps you bring production databases up-to-date. "It's awesome. It clearly shows database differences in a way that is easy to understand." Marius Roets, Integration Solutions. Download today.

In This Issue

Capturing Baselines on SQL Server: Wait Statistics

By capturing baseline data, a well=prepared DBA should get a good idea of what potential issues they will face. In this article Erin Stellato looks at Wait Statistics and what they can tell you about your databases. More »

SQL Saturday #183 - Albuquerque

A free day of training in Albuquerque, New Mexico on Feb 9, 2013. More »

Using the Data Profiling SQL Server Integration Services SSIS task

Have you ever had to write a bunch of TSQL to do some data analysis on the table data in your database. If you have you'll know that this can become a fairly time consuming and tedious task? SQL Server 2012 Integration Services has a feature called the Data Profiling task that can help you perform this analysis much easier and faster (this feature is also available in SQL Server 2008). This task can help you find potential issues with your existing data as well as help you become more familiar with the data in a database that you have just started managing.  More »

From the SQLServerCentral Blogs - How to Remove (Undo) Table Partitioning

I have seen plenty of articles and blog posts out there for how to setup and implement table partitioning, but... More »

Editorial - Dealing with Supervision

I've been working at home for a decade, first for my own company and now for Red Gate Software. In that time, I've learned to manage myself, motivate myself, find work to do, and meet deadlines, all of which I've done without having anyone manage me. Over the last five years I've worked at Red Gate, I'd like to think that I was one of the easier people to manage since I work well on my own. I'm not sure if my various managers would agree, since I know that I can be particular about how I work and not necessarily work closely with others, but at least I haven't required much of their time.

A short while back I was talking with a friend that was under pressure to complete a deployment that was proceeding poorly and their manager stood next to their desk, watching, commenting, and asking how long each process would take. I've had to deal with that situation in the past, and it was  maddening to me. It's hard enough to focus and work on a task when there are problems with the technology. Having someone that can't contribute but is in a supervisory role nearby usually makes things worse.

Ultimately I think micro-management says more about the manager than the employee. There are trust issues or control issues, or perhaps pressure from the manager's boss. It can be hard to deal with micro-management, but if you plan to continue your employment, you need to find some way to deal with it.

There is no shortage of ideas. You can search for "dealing with micro-management" and you will get a wide variety of advice. I've tried different techniques in the past and some have worked, some haven't. The best way to handle micro-management seems to vary with the situation, but it's good to have a few things to try.

» 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:

Will both of these queries will return the same result or not?



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.

The Microsoft Data Warehouse Toolkit: With SQL Server 2008 R2 and the Microsoft Business Intelligence Toolset

As the most influential thought leaders in the data warehousing and business intelligence industry, the Kimball Group has developed pioneering techniques that serve as industry standards for DW/BI system design, development, and management. With this new edition of their bestseller, veteran experts from the Kimball Group get you up to speed with using the new Business Intelligence release of SQL Server: SQL Server 2008 R2. Covering the complete suite of data warehousing and BI tools that are part of SQL Server 2008 R2, the authors follow the full project lifecycle, including design, development, deployment, and maintenance. Get your copy today from Amazon.

Yesterday's Question of the Day

-- Oops! SQL column swap or SQL column clobber?
create table #temp (PK int identity, c1 int, c2 int);

insert into #temp values (1,2);
insert into #temp values (3,2);
insert into #temp values (2,1);
insert into #temp values (5,2);
insert into #temp values (5,3);

select * from #temp order by PK;
-- Swap columns c1 and c2 on a
-- row-by-row basis if c1 > c2

update #temp
 set c1 = c2, c2 = c1
 where c1 > c2;

-- Will column c2 clobber column c1
-- BEFORE column c1 can replace column c2?
-- Do we need a temporary column
-- or variable to correct this?
select * from #temp order by PK;

drop table #temp;

Answer: No, column clobber will not occur

Explanation: SQL is a declarative language, even though it can also be used as a procedural language: However, its power lies in its declarative nature. In a procedural language, a column clobber would occur in the algorithm shown above, but not in a declarative language. This task will succeed as coded, because the database engine, behind the scenes and transparent to the SQL programmer, will create a temporary copy of the entire column c1 for later use replacing selective rows of column c2, after column c1 is ‘clobbered’. Hence the code succeeds.


» Discuss this question and answer on the forums

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.

Featured Script

Create and Populate a Date Dimension Table

Creates and populates a date-dimension table suitable for OLTP or data warehouse purposes 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 : Administering

Log file growing on principal server--log backups scheduled every 2 hrs. - Hi, The transaction log file is growing(currently 99%) and it is close to zero out the disk space. Tranasaction log backups are...

10 physical disks available - best configuration for data/log/backup? - I have 10 300GB SAS 15k rpm 6Gb disks available to me on a HP P2000 SAN. I have a...

SQL Server 2005 : Development

Create string using input values - Hi, I have a beginning Year and a End year and i have to compute/create a string based on the given...

SQL Server 2005 : SQL Server 2005 General Discussion

help needed for sql query - I am working on sql 2005. I have a table wherein it maintains the history of status Customer Status CreatedDate LastUpdateDate CustA...

Load data into excel file from table but each sheet allow 1000 records - Hi All, This is Vivekanand,i have one requirement in ssis that is load data into excel file from table.Table contain 10000...

SQL Server 2005 : T-SQL (SS2K5)

Selection Of Sql Server Version - I am starting a very big project from the scratch.Till now i was using sqlser2005 with Visual Studio.Net2008....Now as my...

Database Design question regarding Normalized Tables - Hey all, Got a theoretical question for you guys. Let's say I have a table that contains information about a store....

Help with SUM and Group By - [code="plain"][code="plain"] Hi! I have a table shown below (just a part of it) and need to aggregate the data as the example...

Problem with Full Text Searching - I have one table in sql server say example Table Name candidates Test table contains some columns cid , cname,c_resume cid in Int...

SQL Server 2005 : SQL Server Newbies

when i am removing user from the server it's promoting an error - Hi........ Any one can provide the solution for the below error in detail. Error Message in SQL SERVER 2005: "Deleting Server logins does...

SQL Server 7,2000 : General

Restore with TSM on a specific date? - Hello, I am trying to retore a database from the 01-29-2013: C:\Program Files\Tivoli\TSM\TDPSql>TDPSQLC RESTORE WSS_Team_Content /RELOCATE=WS S_Team_Content /to="E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MS SQL\DATA\WSS_Team_Content.mdf" /RELOCATE=WSS_Team_Content_Log /to="E:\Program...

SQL Server 2008 : SQL Server 2008 - General

help on group by with Join - I have two tables. One has records for transactions, another has records for purchased products. Transaction table has TransactionID, TotalAmount,...

facing a diffrent problem alltogether - working on indexed views and facing a tough time getting the query optimizer to pick the resultset from Indexed view... :) - SELECT DT.MO_OF_YR_NM [Month], DT.MO_OF_YR [month_No], DT.YR [Year], DT.MIC_WK_OF_MO_NM [Week], DT.DT [Date], CD.CSTMR_NM [Organisation], PD.BS_LN_NM [Business Line], ED.EMPE_NM [Sales Executive], COUNT( CDBF.CSTM

Convert varbinary to integers and insert - Hi, I have a 28 integers stored in a varbinary that is passed to a stored procedure. The SP needs to...

Execute task based on INSERT - but without triggers - Let me try with first defining what I want to achieve, as I'm very new to SQL I don't know...

Error while creating stored procedure from SQLCMD - Must declare the scalar variable - Hello, I'm Getting the following error when I run the below SQLCMD command and not sure how to resolve this issue: [quote]C:\Test>sqlcmd...

my queries are too slow when SET FORCEPLAN OFF - Hi All, I am using an reporting tool for my dwh system. My tool are generating queries and those queries are too...

Query to sum only few values in a same column - Hello all, I am kind of new to sql server and I am stuck on this. It may sound stupid and...

Full & Simple Recovery Model - what is the standard way to put the database Full recovery model OR Simple recovery model?

Fragmentation does not reduce for some tables - I am defragmenting the database as a maintenance work. But i found that some of the databases avg_fragmentation_in_percent does not...

Design Question - I seem to be struggling with something that I thought was fairly straight-forward originally when I started designing the database...

using replication in sql server 2008 r2 SE (OS: windows server 2008 R2 SE) - We are implementing a new architecture for one our modules. There are 100 tables in the database and out of...

like to install the failover cluster in pc - HI, all like to install the fail-over cluster in pc but there is no cluster group and MSDTC Group is not...

Calculating Running Totals for Today and Today Last Year - I'm trying to calculate a running total for today and today last year. Here's what I use for today last...

SQL Server 2008 : T-SQL (SS2K8)

Error while creating stored procedure from SQLCMD - Must declare the scalar variable - Hello, I'm Getting the following error when I run the below SQLCMD command and not sure how to resolve this issue: [quote]C:\Test>sqlcmd...

NOT makes query never complete? - I understand it may be difficult to assist me without knowing my underlying schema and all the details. Let me...

split string to three parts - I have a comma delimited string that's made up of 3 parts: Word1, Word2, Word3 I want to spli the string and...

Searching through text field - I have a text field (nvarchar max) that contains a chat transcript. I need to find the first chat entry...

SQL Server 2008 : SQL Server Newbies

What forum best for question about replication on SQL Server 2012? - Hello, I've looked through the forums to see if I could figure out the forum that would be the best for...

SQL Server 2008 : SQL Server 2008 High Availability

Need suggestions on replication - We are implementing a new architecture for one our modules. There are 100 tables in the database and out of...

SQL Server 2008 : SQL Server 2008 Administration

Creating a new Management Data Warehouse and removing the old one - When I took on the Role of DBA, i inherited some leftovers from the previous DBA. One such leftover was...

SQL monitoring - CURSORUPDATE - i have a procedure that runs it is cursorupdate, but thats about all i can see, anyway to determine what...

what is pending io count - Is someone able to explain what pending_io_count is in sys.dm_os_tasks please. The description on bol suggests it is io done...

Database Mail Stopped Working - Database Mail on our production server was working fine until about mid-morning today. Nothing has changed on the server that...

Career : Certification

Microsoft Certified Master - There's been a lot of debate recently about whether certifications are worth doing and whether they provide you or your...

Programming : Connecting

Port 56731? - We were having an issue where SSMS was unable to connect to a named instance of SQL Server 2008 R2.... : 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...

Reporting Services : Reporting Services

SSRS 2008R2 Data set Properties Error - I have a stored procedure which i have to design the report for this i have connected to the datasource...

SSRS 2008R2 GROUPING - I have add multiple goups in ssrs 2008 r2.My problem is when i try to add a group 1 extra...

Data Warehousing : Analysis Services

MDX and VB FUNCTIONS --- - Hi to all. I write this topic because i need an help about MDX and how to use VB Functions to...

Simple MDX query - Hi, I'm trying to something that I think should be straight forward in MDX but i'm struggling. I'm new to MDX...

Article Discussions by Author : Discuss Content Posted by Michael Coles

Java & SSRS - I am trying to implement bar codes in Java application. Also want to integrate with SSRS reports, how to achieve...