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


There are no shortage of books about cyberattacks and hackers. Some of these fictional stories even postulate that countries will build armies and engage in digital war with other countries. Some of this has come true, with the US and Israel attacking Iranian targets, suspected Chinese hackers targeting the US, and the announcement that Britain is building their own cyber army.

While there are certainly no shortage of attacks made on corporations every day, how long before countries make determined efforts to disrupt their enemies' economies with digital war? It's a scary thought, and given the poor security habits of so many developers, it's possible that many companies might find themselves struggling to conduct businesses while under attack. It might not be any different than if conventional weapons were being used near our facilities.

The state of coding by so many "developers" today is somewhat scary. It's not even old applications that are vulnerable to SQL Injection, but even new systems that have poor security practices being used that are vulnerable.

I think that secure coding practices like these should be implemented by anyone writing software. I think examples, frameworks, and presentations about coding shouldn't use simple passwords and bypass checks. Yes, it's a pain for those that teach, but it also means that shoddy coding practices aren't proliferated as people borrow your code and alter your examples.

Security is a problem, but I think a lot of the issues would be minimized if we, as an industry and professionals, learned to write more secure code as a matter of habit, not as an additional feature to be added later.

Steve Jones from SQLServerCentral.com

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

Video and Audio versions

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 www.everydayjones.com.

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

Steve Jones

Windows Media Video ( 17.0MB) feed

MP4 iPod Video ( 19.9MB) feed

MP3 Audio ( 4.1MB) feed

Feeds are available at iTunes and Mevio

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

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 Monitor

Optimize SQL Server performance

“With SQL Monitor, we can be proactive in our optimization process, instead of waiting until a customer reports a problem,” John Trumbul, Sr. Software Engineer. Optimize your servers with a free trial.

Deployment Manager

Easy release management

Deploy your .NET apps, services, and SQL Server databases in a single, repeatable process with Red Gate’s Deployment Manager. Get started now

Featured Contents


Turbocharge Your Database Maintenance With Service Broker: Part 2

Marios Philippopoulos from SQLServerCentral.com

I demonstrate how to monitor and troubleshoot Service-Broker-task execution in the context of a database-maintenance process. More »


The PoSh DBA – Getting Airborne with PowerShell

Additional Articles from SimpleTalk

Maybe the best way of helping the busy database professional to get started with practical PowerShell-based administration is to pull together all the essential community cmdlets into a toolkit for the POSH DBA, and explain how and why you'd use them. More »


New SQL Monitor Metric: Principals with Sysadmin Login

Press Release from Red-Gate

This metric counts the number of principals who are members of the sysadmin fixed server role. SQL Server relies on role-based security to manage permissions. If multiple IT system administrators have permissions to set up new SQL Server logins, they might be inclined to do so as part of the sysadmin role. Adding a normal user to the sysadmin role could pose a security risk and is not recommended unless the principal is highly trusted. More »


From the SQLServerCentral Blogs - sp_SrvPermissions & sp_DBPermissions V3.0

Kenneth Fisher from SQLServerCentral Blogs

These are a couple of stored procedures I wrote to help me with security research. Each sp returns three data... More »


From the SQLServerCentral Blogs - Dealing with Power Pivot to Tabular Upgrade Errors

Devin Knight from SQLServerCentral Blogs

Upgrading from Power Pivot workbooks to SSAS Tabular models is usually a pretty seamless process.  This is part of the... More »

Question of the Day

Today's Question (by Amit Raut):

What are the analytical functions available in SQL Server 2005? (Select 4)

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 1 point in this category: SQL Server 2005.

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


SQL Server 2012 Integration Services Design Patterns

SQL Server 2012 Integration Services Design Patterns is a book of recipes for SQL Server Integration Services (SSIS). Design patterns in the book show how to solve common problems encountered when developing data integration solutions. Because you do not have to build the code from scratch each time, using design patterns improves your efficiency as an SSIS developer. In SSIS Design Patterns, we take you through several of these snippets in detail, providing the technical details of the resolution. Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Rob Stebbens):

 This is a really simple problem that caught out all of my staff, with them making an incorrect assumption regarding the use of MAX(). A currency table contains the following data.




































What does this query return?

Select max(date), max(exchange_rate)
 from currency

Answer: 2013-07-14,0.011999


The correct answer is 2013-07-14,0.011999

It is important to remember that each MAX() function is evaluated individually

A common mistake is to assume that the MAX peforms filtering on the results set.  Because there is no WHERE clause the max function will aggregate using the entire contents of the table and find the maximum date (2013-07-14) .  The subsequent MAX on exchange_rate will perform and aggregation on the same data set returning, 0.011999.

Ref: MAX - http://msdn.microsoft.com/en-us/library/ms187751.aspx

» Discuss this question and answer on the forums

Featured Script

SQL Data File Information

Avinash Bookwala from SQLServerCentral.com

The SQL Data File Information script displays all data files within a SQL Server database with the following relevant properties: FileName, FileLocation, FileSizeMB, SpaceUsedMB, AvailableSpaceMB, %FreeSpace, FileGrowthMB and FileGroupName.

Simply run script in SSMS after selecting the database you want the script to run against.

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

Subqueries - 1. I need to find the names of the customers who have purchased academic books. (Coding required as Subquery NOT...

SQL Server 2012 : SQL 2012 - General

ms sql server from fci to standalone - We have FCI with 2 nodes running 2012 Enterprise Edition. I wan't to remove fci nodes from both nodes, and...

REPORTING SERVICE - Hello All... Please I would like help on the following regarding reporting services...First here are the basics.. I work as data entry/database...

Scalar UDF different performance on different server - Hi all, I have a query that calls on a UDF. In staging, has the same number of records and...

Table patitioning / partition switching - Hi, I'm fairly certain that I know the answer to this question, but would like some validation nonetheless. A large table,...

Sql Server data replication - Hi, We have a database of size around 100GB. We have to replicate this data to a diff company which is...

SQL Server 2012 : SQL Server 2012 - T-SQL

SQL Report Builder - Hi, Not sure where to put this... Im working in SQL Report Builder (sorry dont know which version) and am having trouble...

Return the last version of set of records - Hello all, I have a query I am working on where an orders table has a version column for each...

SQL Server 2008 : SQL Server 2008 - General

Unable to see the available space value in @alertMessage - Hi Guru's, I am new to this forum and having below issue. The below code is working fine but the problem is...

DB_creator server role.. - hi, i checked number of tutorials in that DB-creator server role can do create alter drop their own database . but this...

Add a grand total row to this SQL pivot query? - EDIT: can someone mark this as closed, I've worked it out for myself? Shame no-one here could help me out but...

Most frequent used stored procedures without access to system tables - Is there a way to determine the most frequently used stored procedures in a given database if you do not...

windows os support for sql 2008 and sql 2012 - I would like to know whether sql 2008 and sql 2012 enterprise/standard or developer edition has support on windows 7...

Disk Usage by Top Tables - Hello All, The report [font="Comic Sans MS"]Disk Usage by Top Table[/font] is very usefull. [b]What is the source of the numbers in...

SQL Server 2008 : T-SQL (SS2K8)

Getting Current Stock Report - Hi All, I have a table for maintaining stocks as follows, InventoryId - bigint TransactionDate - datetime InwardId - int ProductId - int InventoryStatus - int (0 - Available, 1 - Sold) ReferenceNo - nvarchar(50) Description...

SQL Server 2008 : SQL Server Newbies

Full Outer Join - The Input data looks like that : Date Productions 11/1/2013 500 11/30/2013 100 10/1/2013 10 10/20/2013 50 11/1/2012 1 11/20/2012 5 Current Month Previous Month Previous Year 500 10 1 100 50...

SQL Server 2008 : SQL Server 2008 Administration

Merge Replication - is it possible to have a Publisher as 32 Bit SQL Server and Subscriber as a 64 Bit SQL Server. - We currently have 1 publisher and 1 subscriber for our Merge replication setup. We currently have SQL Server 2008 standard edition...

Corrupt Backup File ? - I got this message when trying to restore a DIIF backup Msg 3183, Sev 16, State 2, Line 91 : RESTORE detected...

SQL Server 2005 : Administering

database options not being copied from model db - I have made some db level changes on model db and the intent was to have those settings copied over...

SQL Server 2005 : Business Intelligence

Execute Child packages parallel in loop - hi , I have a master package which calls the child packages from a folder dynamically, when i tried this with...

SQL Server 2005 : SS2K5 Replication

Please advise for replicatd DB strategy. - Dear friends, though I use sql server 2012, this is the replication forum so I post here. I have 4 db with...

Restart jobs for transactional replication - I want to restart replication jobs for transactional, So can you please tell me do i need to restart both...

SQL Server 2005 : T-SQL (SS2K5)

Concatenating columns returns NULL results - When I concatenate 2 columns, it returns NULL result. Column1 has some NULL value. How do I ensure it displays...

Reporting Services : Reporting Services

Extend the matrix list based on Prompt's selection - Goal: Display and extend the sub column state of australia and canada in the matrix list when pressing one of the...

Data Warehousing : Integration Services

Insert performance in SSIS - Hi all, I was reading up on this article: http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/102924/ And I was wondering in the article it was about updating the tables...

Data Warehousing : Analysis Services

Discover Cube Error befor Production Phase - Goal: Apply a fresh deployed cube in the production environment. Problem: How should I enable to discover any problem in the cube when...

Career : Job Postings

Jr. Business Intelligence Analyst (Mid-Michigan) - Two Men and a Truck International is looking for a Jr. Business Intelligence Analyst. This is a direct hire position....

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 ©2013 Red Gate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com