In this issue

Featured Contents


Featured Script

SQL Search How do you search your database schema?
"I use SQL Search regularly and think it's great." Gregor Suttie, Senior Software Engineer, Pulsion Technology. Download Red Gate SQL Search while it's free.
SQL DBA Bundle Top 5 Hard-earned Lessons of a DBA
New! Read Lesson 3, ‘Six Scary SQL Surprises’, and learn from Brent Ozar and the other experts in the DBA Team. Read now.
SQL Developerbundle 12 essential tools for database professionals
The SQL Developer Bundle contains 12 tools designed with the SQL Server developer and DBA in mind. Try it now.

In This Issue

A Simple Formula to Calculate the ISO Week Number

He admits it wasn't his idea but his head sure wishes it was. SQL Server MVP Jeff Moden explains a wonderful, super simple, very high performance formula that will calculate ISO Week Numbers. If you're "stuck" with SQL Server 2005 or less, you're going to like this a whole lot! More »

SQL Saturday #189 - Costa Rica

Join us at SQL Saturday Costa Rica on April 13, 2013 for a day of SQL Server Training and Networking. More »

SQL Server JOIN Hints

You, as a SQL Server data professional, are looking for ways to improve your queries. You've done the usual - avoided cursors and loops, used locks effectively, examined execution plans - what else can you tweak? Check out this tip to learn more. More »

From the SQLServerCentral Blogs - Analysis Services Webinar Recording and Q&A

I hope you were able to attend my free webinar on Introduction to Analysis Services on April 2, 2013.  If... More »

Editorial - Double Compliance


I haven't ever been bound by HIPAA or PCI regulations with the data I've managed. Those laws hadn't been enacted when I worked in those industries, and so I've never had to go through an audit. I have been through ISO 9000 and SOX audits, and I found those audits to be both a pain and also a good idea. Various inconsistencies and exceptions in our policies were found, often strengthening our security or bringing more consistency (and stability) to our organization. Those two audits were also very close in scope and requirements. If we could pass one, we typically could pass the other.

However PCI and HIPAA are not the same, and you shouldn't expect that passing one would mean you could pass the other. For most of us, we wouldn't be bound by both of these, since they are applied to the financial and medical fields respectively. However as we look to move forward and use new partners in business, including cloud services, we should be aware that just because a company has one certification doesn't mean they have the other. If your business partner is PCI complaint in some way, I wouldn't assume that this means they are in any way HIPAA compliant, and vice versa.

Should we have standards for data protection that matter to a variety of industries? I'm not sure we should, despite the hassles that may mean for those of us bound by these regulations. Each industry and type of business has it's own requirements, some of which are not applicable to other fields. Trying to build one standard for privacy, security, or any other requirement is likely to mean a watered-down, ill-fitting regulation that doesn't protect any data well. Instead we should have specific requirements we need to meet to provide security (or any other need), without specifics on the technology or implementation used.

Most of you probably don't like the idea of any regulation, and I'd like to agree with you. However I've seen too many people ignore good practices, engage in morally debatable activities, and in general treat other people, and data, in a way they wouldn't want to be treated themselves. A little regulation, that limits abuses and gross malpractices is a good thing. Too much regulation, specifying details that are often obsolete before they can be enforced, is a bad idea.

» 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 does this script return on SQL Server 2008?


















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.

SQL Backup and Restore

A DBA's tasks, from day-to-day, are rarely constant; with one exception: the need to ensure each and every day that any database in their charge can be restored and recovered, in the event of error of disaster. In this book, you'll discover how to perform each of these backup and restore operations using SQL Server Management Studio (SSMS), basic T-SQL scripts and Red Gate's SQL Backup tool.

Get it from Amazon in print  or download the ebook for free from Red Gate

Yesterday's Question of the Day

In SQL Server 2012, what are the three options for setting CPU limits in the Resource Governor?


  • CAP
  • MAX
  • MIN

Explanation: The three options are cap, max, and min. CAP is new in SQL Server 2012.


» Discuss this question and answer on the forums

Microsoft® SQL Server® 2012 Step by Step

Teach yourself the programming fundamentals of SQL Server 2012—one step at a time. Ideal for beginning SQL Server database administrators and developers, this tutorial provides clear guidance and practical, learn-by-doing exercises for building database solutions that solve real-world business problems.

Get your copy from Amazon today.

Featured Script

Rename Foreign Key Constraints

Rename Foreign Key Constraints in a consistent manner. Ideal for preventing constraint errors during code promotion. 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

Reg:Sqlserver Named Instance - Hi 1) How to set a static port in sql server named instance? 2) Same Public IP but different machine...

SQL Server 2005 : Business Intelligence

Loading Fact Tables - Step by Step Instructions Challenge - Dear All, This is my first Data warehouse project and I am having serious problems loading my fact table. I...

SQL Server 2008 : SQL Server 2008 - General

Pushing Data from T-SQL to Visual Studio While Debugging - I am debugging my T-SQL code in Visual Studio ... is it possible for me to write something in my Transact-SQL...

200-101 testing and training materials - Cisco posed the question, "Does Home Cisco 200-101 collect my location?" and answered it as follows: "Cisco Home doesn't use...

Possible to alter a server-side trace without deleting and re-creating? - On the servers I'm now responsible for, the previous DBA implented a server-side trace. This trace logs quite a bit,...

Impersonate possible for a security group? - Hi everyone, I was thinking of publishing some Table Reports with an online connection to my MSSQL server. All of that works...

Monitoring Connections to Databases - Hi - I have a task to provide a list of applications that connect to one of my databases. I'd like...

SQL Server 2008 : T-SQL (SS2K8)

Confused selecting Info From Two DB - i have two database AgencyDB(primary DB) and AgencyBackupDB(Deleted Info from AgencyDB by user) and i have this three table in...

Query performance help needed - I have multiple pairs of "Offers" and each Offer is comprised of several lists of "Items". My pairs of Offers are...

SQL Server 2008 : SQL Server Newbies

How to get difference between two dates in days and hours? - Hi, I'm looking code to find difference between two dates in days and hours. Example: date1: 2013-04-07 14:45:41.013 - date2: 2013-04-05 10:45:41.013 I...

Slows system performance - Dear All I am running a process (updation/deletion/insert) of 2 million records. After some time this process makes my system very...

SQL Server 2008 : Security (SS2K8)

How to impersonate an AD Login within a AD Group defined in SQL - We have active directory groups defined within our SQL 2008 server. I have another AD login defined on the server....

SQL Server 2008 : SQL Server 2008 Administration

sql server how to split a mirrored db on to multiple devices - Say I have a large production mirrored 1TB DB that resides on a single MDF device and I would like...

Huge DIFF Backup, Normal T-Log Backups - I have a 55 Gig database, and the differential backup for yesterday was 32 Gig !! It was about 5 gig...

SQL 2008 Audit doesn't show parameters - I need to audit all accesses, updates, inserts, deletes, executes, etc. done to specific tables in our database. I upgraded...

Reporting Services : Reporting Services

How to repeat interim running total to next row - Hi, I think a fairly simple question, but I wonder how to do it in SSRS 2008 R2: I have a table...

SSRS 2008 R2 - SEGMENT table - Hello All, We are using SQL server 2008 R2 SSRS. The segment table in the SSRS database (Not SSRS Tempdb database)...

Data Warehousing : Integration Services

Query help for Data pulling - I need to pull the info from excel to the Database table through SSIS. I need logic for below scenario. Excel...