In this issue

Featured Contents


Featured Script

SQL Backup Pro Get compressed, verified, secure SQL server backups
Use SQL Backup Pro's automated scheduling to get faster, smaller backups. Then verify your restores using DBCC CHECKDB in one easy, automated process. Download a free trial now.
sqlsourcecontrol Database source control in just 5 minutes
It takes just 5 minutes to connect your SQL databases to source control. Got 5 minutes to spare? Get started now.
SQL Monitor Get alerts within 15 seconds of SQL Server issues
SQL Monitor checks performance data every 15 seconds, so you can fix issues before your users even notice them. Start monitoring with a free trial.

In This Issue

Throttle a Query in Mid-Execution

Resource Governor provides a great mechanism for throttling resources, but it doesn't always allow granular control. Read about this trace flag that allows you to dynamically alter the resource usage of a query. More »

TSQL Pivot Rotations using only REPLACE

Pivoting SQL Server tables is always awkward, even with the PIVOT and UNPIVOT operators. If you want to get the job done without GROUP BY or PIVOT, here is a way to do it using only REPLACE. More »


If you’re involved in the database world it’s hard to have missed the rise of the “no-sql” database products, designed to – depending on your view or the product I suppose – make databases simpler, break out of the transaction database paradigm, scale out across hundreds of machines, make it easy to change the db design (or not require one). I think some of the problems no-sql tries to solve are real, others reflect a lack of awareness/training/tools on how and why relational databases could not just solve the problem, but solve it better. More »

Editorial - Google Glass Your Database

I'm sure most of you have heard of Google Glasses by now. This is a hardware platform, literally built into a set of glasses that's designed to mate with your Android cell phone and allow you to access and use your phone in conjunction with your glasses. It's an interesting idea, and while I'm not sure if it will catch on, I'd like to see some parts of this technology come to fruition.

There's a new company that is trying something similar, providing a new way to access databases. Virtual Search, Inc. has combined a set of glasses with a built in display with a set of virtual reality gloves and proprietary software to allow you to search your Analysis Services cubes in a quick and intuitive manner. 

Users can connect to a cube and then visualize the aggregations in a starscape-like manner. With gestures that are customizable for each user, the software allows the wearer to quickly add or remove filters along dimensions and measures in a way that can speed up querying for the business user. Data dictionaries and other meta data can pop up in the display on the side as users quickly move through what-if scenarios.

I have to think this would be an easy sell in many companies, if only for the cachet of cool that this would bestow upon the users. I'm sure many of my employers would spring for the hardware and likely fund a project to build new cubes to test the interface. I'm also sorry to tell you this isn't true, nor likely to be true. It's my little April first thought for the day. As a short apology, the podcast for the day is a series of bloopers so you can laugh at my inability to record a short 3 minute segment each day.

Hopefully you enjoyed this and while you might be drooling over the prospect, you aren't too disappointed. If any of you software developers are so inclined to try building something like this, you might float your idea over at Kickstarter.

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


Here are a few funny moments from the podcasts


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

Question of the Day

Today's Question:

In which version of SQL Server did the SET ROLLBACK_TIMEOUT = X get added? (X is the number of milliseconds before an automatic rollback is initiated for a connection that is not actively running a command.)

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

This question is worth 7 points in this category: humor. 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.

Yesterday's Question of the Day

declare @a char(5), @b char(5), @c char(5)

set @a = 'abcde'

set @b = ' ab'

set @c = 'ab '

select LEN(@a), LEN(@b), LEN(@c)

What will be returned by the select statement?

Answer: 5, 3, 2

Explanation: LEN() returns the number of characters in a string, excluding trailing spaces (both those included explicitly during the assignment and the ones added by the padding of data types char and nchar), but not leading spaces.

Reference: LEN -

» Discuss this question and answer on the forums

SQL Server Execution Plans

SQL Server Execution Plans shows you what's going on behind the scenes in SQL Server. They can provide you with a wealth of information on how your queries are being executed by SQL Server, including: Which indexes are being used, and where no indexes are being used at all. How the data is being retrieved, and joined, from the tables defined in your query. How aggregations in GROUP BY queries are put together. Grab your copy today from Amazon!

Featured Script

Create Table with T-SQL

Generate create table statement using T-SQL. 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 : Development

guidence concerning pivot table - Hi, i have a table which looks like this: custid item date amount 1 3 1-1-2013 1 1 2 1-1-2013 2 2 4 1-2-2013 2 2 4 1-2-2013 1 and i want to make it look like this: date item1 item2 item3 1-1-2013 custid 1 2 0 1 1 3 1 1 1 4 1 1 1-2-2013 custid 2 5 1 1 2 1 1 1 2 4 1 1 can...

SQL Server 2005 : SQL Server 2005 Security

locking table - Hi, I have a table - how to lock my table not to INSERT/UPDATE/DELETE plz answer me... regards, kannak.....

SQL Server 2005 : SQL Server 2005 Integration Services

SSIS and dealing with embedded double quotes and coma - I posted my problem in other thread also but no go, I think this is the right forum to post...

SQL Server 7,2000 : Administration

troubleshooting sql server 2000 slowness - Hi for few days i am going to work at client side which has sql server 2000. I am knew...

SQL Server 2008 : SQL Server 2008 - General

Publishing and accessing SQL Server 2008 Reports - I 'm new to SQL Server database and I need help. I 'm trying to publish sql reports for users...

split fixed width row into multiple rows in SSIS - I Have a fixed width flat file and that needs to be loaded into multiple oracle tables(one row need to...

TRIM and Date Format question - I have tried using the TRIM function in the below query to remove a leading zero in the Department Code...

Newbie (Know-nothing-bie:) Needs Urgent Assistance with SQLExpress - I have very little experience with SQL other than using it. I am a hardware tech. But I do have...

Eliminate FileGroup and move contents to Primary FG - Hi there, I'm looking for some guidance on how to resolve something I've been tasked with. I am working on a DB...

Unplanned outages causing bankruptcy - * I wasn't sure where to ask this throughout the forum, so I decided here was best. * For my thesis in...

Low Procedure Cache Hit Rate means no use of stored procedures? - Hi everyone. I'm not really understanding how the procedure cache works in SQL Server 2008 R2. I have 100GB ram allocated...

SSIS question on CSV Import - Many people may have faced this problem and I searched many solutions but somehow I could not hit the right...

How to preserve global temporary table data - Hi guys, I would like to know if anyway to preserve global temporary table data till some one explicitly drop it....

Multiple order by in a result set - I have a specific requirment where a table contains a column called ‘Empno’ with the values 12, 34, 3, 78,...

Problem having restoring database backup file on secondary server - Hi for last two days at one of our client side we have been trying figure out a why its...

SQL Server 2008 : SQL Server Newbies

Cursor in Stored Procedure - Hi, I am a SQL newbie and need to update code in a Stored Procedure that has a cursor. Is it...

Query join - Hi there, hope in your help. In my DB I've two tables: TABLE_LONG and TABLE_SHORT. The two tables are equal but in...

Columns to be included in Index - Dear All I have one table with millions of rows, with columns as Id, stringcol1,stringcol2,Bigintcol3,numericcol4 Primary key is Id. Index created on stringcol1 When...

New San/Compellent testing - I need to create a query that will execute for 20 minutes or more so that connectivity and redundancy can...

Obtaining Before & After Record & Missing Record. - I have a database that has two tables. On table is a date table that has all of the possible...

SQL Server 2008 : Security (SS2K8)

Cannot use the special principal "dbo" - Hi, In one of our servers, there was a created a login name = <domain>\FarmA This was assigned as username = 'dbo' to one...

SQL Server 2008 : SQL Server 2008 Administration

Can I strictly limit access to database ? - Hi, I'm new in SQL Server administration however I need to make some major modifications in my SQL Server database. There...

Version Change in Change Tracking - Hi, If any INSERT, Update OR delete operation happens in the table than a new version (SYS_CHANGE_VERSION) will get created or...

Script to calculate when a job ended. - I need to alter the script listed below to calculate the DateTime that the Job completed and sort on the...

Career : Certification

Exam 70-461 - Hi, Ive just ordered the book: Querying SQL Server 2012 Training Kit. I am planning to take the exam 70-461 within...

70-461 - Hi, Id like to take this exam and looking for some good prep.. My T-SQL skills are basic at present... : 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

5 parameters in a report - Hi All, I'm creating a basic report with 5 parameters. I want to populate the drop down menu of the...