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

Frustration with Bad Design

This is not how you handle things. When you find security issues, and they don't get fixed, it's one thing to attempt to prove a point with a PEN test. It's quite another to publicly expose information. You might find yourself in trouble, and you should be in trouble. This is a violation of the professional responsibility you undertake when working for someone.

This is the type of frustration that occurs in many IT workers. I've seen more than a few people working in technology that are sure they know how to properly configure and manage an application. They know how to set up security, and they become upset with a company that doesn't do a good job of running internal systems. They know that the architecture chosen for their application will fail when a load is applied.

There are some smart people in IT, but sometimes they think they're smarter than they are. Bad design, bad decisions, mistakes, even poor security practices will occur. However it's usually not your company, and it's not your place to prove that there is a flaw in a system. It's especially true that it's not your place to prove things without having been given permission to do so. Proving a point on your own is something children do, not professionals.

When you find problems in your organization, it is your responsibility to report them. I hope you think it's your job as a professional to do the best job you can, following the best practices as we know them. It's also your decision to choose to leave a job if you can't go along with, or abide by, the decisions made by your management.

If your company has chosen poorly in their technology decisions, I understand your frustration. I've often shared it, but I'd advise you to do what I've done. State your objections and either support the chosen path or find another job.

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 ( 2.3MB) 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. Support this great duo at www.everydayjones.com.

Everyday Jones

Follow Steve Jones on Twitter to find links and database related items and announcements.

Understanding SQL Server Concurrency - FREE eBook

Understanding SQL Server Concurrency - FREE eBook

Read Kalen Delaney's free eBook "SQL Server Concurrency: Locking, Blocking and Row Versioning" to learn all about concurrent access, troubleshooting deadlocks, and more. Download the free eBook

SQL Prompt

5 ways to code effortlessly

Discover the different ways you can make writing, exploring, and refactoring SQL code refreshingly effortless with SQL Prompt 6. Download a free trial.


Once Upon a Time in Compareland…

Jack spent two days manually checking his database upgrade script for mistakes. Then his boss sent him the license key to their newly purchased SQL Compare. “It’s so fast” he sobbed as tears of joy quietly plopped into his beer at 6, hours before he thought he’d be able to leave the office that night. Read more about SQL Compare.

Featured Contents


How to Handle Calculations Related to fiscal year and quarter

Raymond Xie from SQLServerCentral.com

This article describes an easy way to handle calculation based on fiscal year and quarter More »


Microsoft Azure Cloud Services Part 2: Anatomy of a Cloud Service

Additional Articles from Just Azure

In this article, we’ll be focusing on the different ways you can build with a Cloud Service, and what exactly happens in terms of virtual machines when you deploy your application. More »


From the SQLServerCentral Blogs - Add them to ALL the roles!

Kenneth Fisher from SQLServerCentral Blogs

I seem to get a lot of permissions questions these days and one of the more frequent ones goes along... More »


From the SQLServerCentral Blogs - Steps to install Service Pack for SQL Server 2005 – Multiple Instances

Steps to install Service Pack for SQL Server 2005 on multiple instances in one go :- Step 1 : First page of... More »

Question of the Day

Today's Question (by Stuart Davies):

Assuming xp_cmdshell is enabled, how many rows will there be in the output file (C:\Exports\data.csv) from the following script?

      [UniqueId] [int] IDENTITY(1, 1)
                       NOT NULL ,
      [EmployeeName] [char](10) NULL,

INSERT  INTO #Employee
        ( EmployeeName
        SELECT  'Brian'
        UNION ALL
        SELECT  'Mary'
        UNION ALL
        SELECT  'Neil'
        UNION ALL
        SELECT  'Fred'
        UNION ALL
        SELECT  'Steve'
        UNION ALL
        SELECT  'Aaron'
        UNION ALL
        SELECT  'Jason'
        UNION ALL
        SELECT  'Andy'
        UNION ALL
        SELECT  'Clare'
        UNION ALL
        SELECT  'Lynn' 

DECLARE @BcpCommand VARCHAR(250)

SELECT  @bcpcommand = 'bcp "SELECT EmployeeName   FROM #Employee WHERE UniqueId <= 7" queryout "C:\Exports\data.csv" -c -T '

EXEC master..xp_cmdshell @bcpcommand, NO_OUTPUT

DROP TABLE #employee

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 2 points in this category: T-SQL.

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


Professional Microsoft SQL Server 2014 Integration Services

The 2014 release of Microsoft's SQL Server Integration Services provides enhancements for managing extraction, transformation, and load operations, plus expanded in-memory capabilities, improved disaster recovery, increased scalability, and much more. The increased functionality will streamline your ETL processes and smooth out your workflow, but the catch is that your workflow must change. New tools come with new best practices, and Professional Microsoft SQL Server 2014 Integration Services will keep you ahead of the curve. SQL Server MVP Brian Knight is the most respected name in the business, and your ultimate guide to navigating the changes to use Microsoft SQL Server Integration Services 2014 to your utmost advantage. Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Sarvesh Gupta):

Which of these describes how a correlated subquery is processed?

Answer: Uses the result of an inner query to determine the processing of an outer query.


The corrent answer is C.

A correlated subquery uses the result of an inner query to determine the processing of an outer query.

» Discuss this question and answer on the forums

Featured Script

Find server in complex CMS hierarchy

Cheetah from SQLServerCentral.com

List all the instances with their paths as stored on CMS.

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 2014 : Administration - SQL Server 2014

400 400 pres by::: The Brickyard 400 pres by Golden Corral Live - Welcome To join here for watching!! You Are Most welcome to enjoy Racing your are surfing internet for get your...

Upgrading SSRS from 2000 to 2008 - I am trying to upgrade SQL 2000 reporting services to SQL 2008. I backed up the ReportSever and ReportServer TempDB...

SQL Server 2014 : Development - SQL Server 2014

How to join INFORMATION_SCHEMA.COLUMNS, COLUMNS_UPDATED ( ), inserted and deleted tables - Hi :) On google, i found a script for Update Trigger without using a Cursor (). Line 32 to 74 http://beyondrelational.com/modules/2/blogs/71/posts/11988/how-to-find-the-right-columns-updated.aspx And here is...

SQL Server 2012 : SQL 2012 - General

SQL Alias between client and server - Hi, I am trying to set up a client alias to connect to a named instance on another server but for...

SQL Server 2012 : SQL Server 2012 - T-SQL

Issue With Producing Running Total Column In Select Clause - I want to create the following scenario. I have a table that stores employees working on projects and their project...

TSQL Script help for new user - Hi all, I'm hoping someone can help as I'm clueless :) I'm looking for some TSQL script that filters the method field...

Restore Database by Store Procedure - Hey guys! I need to create a procedure with Restore Database command in many applications in differente platforms. But i can't "use...

SQL Server 2008 : SQL Server 2008 - General

Unspecified error using ado command to update a varchar max field - Hello... I posted this a couple of days ago on the "anything that is not SQL" forum but had no...

Indexes - Clustered indexed column included in a nonclustered index - Hi there - I have recently noticed that there are a lot of indexes in my database which include multiple fields...

SSIS package turns yellow and stops. - Hello all, I have a SSIS package that consists of a Foreach file Enumerator and a Foreach ADO.NET Schema Rowset Enumerator....

Locating SQL Server Express on Network Drive - I have an Instance of SQL Server 2008 R2 Express that I use exclusively for testing and development. I would...

easy tool to capture data changes - Hi, Is it possible to enable CDC on[b] all tables[/b] in the database ? also is it possible to find which tables...

DB transaction log file on a shared hosting service - Hi, Thanks to this forum. It's great. I have a SQL DB on a shared hosting service (NewTek/The SBA) with 400Mb disk...

Good script for index maintenance - Hi All, I wonder is there any good script for index maintenance ? ..especially how to define of fillfactor number on certain...

Replication Vs Log Shipping Vs Mirroring - Which One Should I Use? - Hello, I've been looking at the various redundancy/failover technologies within SS2008R2 and was wondering which one of the following to use...

SQL Server 2008 : T-SQL (SS2K8)

SQL Query Help Please - Hello Everyone, I need to write a report where I query against my table that holds employee's Pay Data, I look...

SQL Statment - I need help to create the right SQL statment for my issue. In the table are two different values separated by...

T-SQL to add 7 days to ship date - Hello All, A quick question to all regarding my query. Below statement adds 7 days to the shipment date if we...

Cross Join Help - I have a massive table (company, plant, resource, part number) that I need to create a from part number, to...

Encrypt SSN Example (TDE) - Does anyone have an example on encrypting a SSN Field using TDE? Any help would be greatly appreciated. Thank you,:-)

SQL Server 2008 : Working with Oracle

Error when selecting top N records from oracle - I am writing a large select statement in MS SQL to select data from linked Oracle 11g server. Started with this e.g. Select...

SQL Server 2008 : SQL Server 2008 Administration

Wait Type Suspended Wait Type CXPacket Request Command Insert - I have a Wait Type Suspended Wait Type CXPacket Request Command Insert going on for 7 hours. It is the only...

MINIMUM events and fields need to be captured in trace. - Experts, Network team complaints that there's heavy I/O traffic between SQL Server and an application server. Though no issues reported anywhere they...

SQL Server 2005 : Administering

SQL SERVER 2005 INSTALLATION ERROR - I had sql server 2005 in my computer. I had to reformat the computer. After that I tried re-installling sql...

SQL Server 2005 : Business Intelligence

SSIS: DTS_E_OLEDBERROR and DTS_E_PRIMEOUTPUTFAILED - Hi Guys, I have a Simple Package that Loads Data from Oracle Table to Sql Server Table. For Source Connection i have...

SSIS and BIDS - Hi to all I want use for practice and learning purpose the SQL Server Integration Services ETL tool and Business Intelligence...

SQL Server 2005 : T-SQL (SS2K5)

Union With IF - Hi Everyone, If @NPI and @TIN both are null, i dont want to run last 3 unions. If one of them...

T-SQL to add 7 days to ship date - Hello All, A quick question to all regarding my query. Below statement adds 7 days to the shipment date if we...

Setting a column to the same value for each associated group of rows in a table - Hi, I need help with the sql to update column values in a table. I have a table of imported data...

Programming : XML

Adding a Header Row to a SSIS package exporting out as XML - I've been asked to create an SSIS package to export data out as and XML file. I've got the xml file...

Programming : Powershell

PowerShell with a focus on automation (and a little SQL) video (90 minutes) - An entertaining evening on the art and science of writing scripts in PowerShell targeted especially for beginners. Interspersed with live demos,...

Data Warehousing : Integration Services

Bug in foreach loop with ado.net enumerator - Hi Greetings to everyone, Today I am going to report a bug in SSIS 2012. In one of the packages I...

Help me: How to capture the execution results (execution time) ?? - Hi Friends, I am just entering into the world of SSIS, I have to capture each of the execution time (please...

SQLServerCentral.com : 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...

Career : Certification

How many tests do I need for 2012 after I get my MCITP - OK, I'm desperate to figure out how many exams I have to take after I finish the SQL 2008 exams...

This email has been sent to {user_email}. To be removed from this list, please click here.
If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com.
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 ©2014 Red Gate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com