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

The Pressure to Compromise Ethics

There have always been those that seek to defraud, deceive or mislead their customers. In order to do this, someone inside an organization has always been willing to pressure employees to compromise their ethics and morals. Construction companies may use substandard materials or ignore standards for construction. Financial companies falsify performance records of products. Medical professionals may order unnecessary tests to charge more. Perhaps one of the common areas many people feel cheated is with used vehicles, where there are numerous stories of deceit from companies and individuals. I've had my own experiences with cars to support this.

It may be no surprise to you this is also happening in the digital world, which seem fundamentally more disturbing to me. After all, software is constantly changing in a way that many other industries don't. We can fundamentally rewrite the rules under which systems work by deploying new code, something many of us do on a regular basis. What's more, we have rules and regulations that fundamentally prevent us from disclosing how the systems work, limitations that don't allow for anyone to easily audit or evaluate what the programming might be doing.

This is different than a car, where we can examine the components and test them, or have a third party perform this for us. It's different than health, where we can solicit second opinions. Even construction has inspections from independent groups that can verify some specification is met. However, none of that exists for software. In fact, our industry resists remotely attempting to implement any sort of ethics by limiting access to source code.

There's an article that lists some of the issues developers have encountered. It also talks about teaching ethics as a way to reduce the impact, which is a good idea. But without any sort of accountability or transparency into the actual code, I'm not sure ethics will help much. There are always people that need a job, and may be willing to write code that continues to provide a paycheck because they aren't sure they can get another job. I know most of us would like to think we wouldn't succumb to pressure, but it can be hard to be sure what you'd do until you are confronted with a particular situation.

I do think this is a problem that will grow, and become more pervasive in the digital world, precisely because no one really knows what software is doing under the covers, and it's hard to even determine what might be happening if you could access the source code. After all, can you be sure that code you get is actually what is running? You can, but not easily.

What I'd like to see is some sort of framework that allows us to specify the behaviors of our software, along with the data movement and handling so that end users would have an understanding of how the software should work. Maybe some automated way of producing a "contract" based on the code. Then we could resolve disputes without ever needing to examine the source.

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 ( 4.4MB) 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.

ADVERTISEMENT
SQL Clone

SQL Clone – create database copies fast!

Create copies of production databases and SQL backups in seconds and save up to 99% of disk space using SQL Clone. Redgate’s new tool removes much of the time and resource needed to create and manage database copies, allowing teams to work on local environments to develop, test and diagnose issues faster. Join the beta.

SQL Compare

New Redgate SQL Compare 12 has landed!

SQL Compare 12 has landed with a brand new user interface, support for SQL Server 2016, and a wealth of fixes and improvements. Check out this blog post from Redgate's Carly Meichen to hear more about what’s new, why the team have built it, and how. Read now.

DLM Dashboard

Track schema changes for free

DLM Dashboard tracks SQL Server databases to show you exactly what schema changes have been made, by who, and when. You get a full history, with line-by-line differences, and a clear audit trail of your database moving from development to production. Download free tool.

Featured Contents

 

SQL Server 2016: The New @OneResultSet Parameter in SP_SpaceUsed

Kenneth Igiri from SQLServerCentral.com

EXEC SP_SPACEUSED can return only one result set if you want it to. This is possible using a new parameter in SQL Server 2016. If are familiar with the inbuilt stored procedure sp_spaceused, I am sure you will find this new parameter quite useful. More »


 

Free eBook: SQL Server Transaction Log Management

Press Release from Redgate

When a SQL Server database is operating smoothly and performing well, there is no need to be particularly aware of the transaction log, beyond ensuring that every database has an appropriate backup regime and restore plan in place. When things go wrong, however, a DBA's reputation depends on a deeper understanding of the transaction log, both what it does, and how it works. More »


 

How to Get the Output of a Stored Procedure into a Table

Additional Articles from Database Journal

Putting the output of a stored procedure into a table provides you multiple options for parsing and using the output with other TSQL commands. Read on to learn more. More »


 

From the SQLServerCentral Blogs - SQL Server 2016 service pack 1 is here!

Koen Verbeeck from SQLServerCentral Blogs

SQL Server 2016 service pack 1 has been released and it is a mayor one! You can download it here. Why,... More »

Question of the Day

Today's Question (by Partha Mandayam):

Which of the following stored procedures can be used to perform the same activity on every database on the instance?

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: Database.

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

ADVERTISEMENT

Expert T-SQL Window Functions in SQL Server

Expert T-SQL Window Functions in SQL Server takes you from any level of knowledge of windowing functions and turns you into an expert who can use these powerful functions to solve many T-SQL queries. Replace slow cursors and self-joins with queries that are easy to write and fantastically better performing, all through the magic of window functions. Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Renato Buda):

 DECLARE @T1 TABLE (COL1 char(1)); DECLARE @T2 TABLE (COL1 char(1)); INSERT INTO @T1 VALUES ('A'),('B'); INSERT INTO @T2 VALUES ('A'),(null); SET ANSI_NULLS ON SELECT COL1 FROM @T1 WHERE COL1 NOT IN (SELECT COL1 FROM @T2) SELECT COL1 FROM @T1 T1 WHERE NOT EXISTS (SELECT * FROM @T2 T2 WHERE T2.COL1=T1.COL1) SELECT COL1 FROM @T1 EXCEPT SELECT COL1 FROM @T2;
Running the SQL above produces 3 resultsets. What are the 3 results?

Answer: nothing + B + B

Explanation:

When ANSI_NULLS is ON, we run this code. 

 SELECT * FROM T1 WHERE col NOT IN (SELECT col FROM T2)

The WHERE clause will always be false if the subquery has any null values. This is the same for permanent tables.

Ref: SET ANSI_NULLS - https://msdn.microsoft.com/en-us/library/ms188048.aspx


» Discuss this question and answer on the forums

Featured Script

Fix Orphan Users

S M from SQLServerCentral.com

If you need to fix orphan users you can use my script. Now if you want to run against all databases you can have one more loop and get that passed to get it fix.

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

Service broker, Endpoint and LISTENER_IP - Hello. I have a doubt. I don't exactly know how the option LISTENER_IP works to create an endpoint for service broker. Does the...


SQL Server 2014 : Administration - SQL Server 2014

Number of logical reads very different between 2 supposed identical environments - Hello, What parameters can have an impact on "number of logical reads" ? UAT and PROD environments are supposed to be the...


SQL Server 2014 : Development - SQL Server 2014

Select continual date ranges from a list that overlaps - Hi There, need some help. I have list of prices and the dates they are valid from and to. For Example: Date...


SQL Server 2012 : SQL 2012 - General

TempDb File Sizing - I have inherited an infrastructure in which the tempdb is set up with multiple files, 8 all told (mdf and...

Accessing lookup tables - Hi I'm creating sql views that access lookup tables to return the full description from a table that holds a...

Time for a consultant - I haven't discussed this with management yet ( so not ready to entertain offers ) but I think it's time to bring...


SQL Server 2012 : SQL Server 2012 - T-SQL

TSQL query - Hello, I have a table A like below Acctnum StartDate AAA 07312016 BBB 06302016 And I am looking to create below output table...

Code first vs rightsizing nvarchar(n)/nvarcar(max) - I'm working on a project with a co-worker and I was working on creating a database for some integration of...


SQL Server 2008 : SQL Server 2008 - General

SQL2008R2 FIFO Allocation Recursive CTE - Hi All, I have been presented with a task to write a FIFO allocation Recursive CTE (or any other solution that...

BULK INSERT failing. - Hello, I have a situation where I am trying to do a bulk insert of a file that's on a network...


SQL Server 2008 : T-SQL (SS2K8)

Last 2 years and YTD - I am losing my mind..:) Can someone please help me with how to implement: YTD Plus the prior 2 Full Years (In...


SQL Server 2008 : SQL Server 2008 Administration

Can I do restore from database set to 2008 R2 compatibilty on version 2012 instance to 2008 R2 instance? - I am putting together a "recovery" plan if hardware fails, and since the business allows 120 minute recovery window, I...


Programming : General

Want to learn SQL - Dear Friends, Please suggest me some sites to learn SQL online. Thanks in advance.


SQL Server 2005 : Administering

error: during upgrade database raised exception 945 severity 14 state 2 - I am getting this error after a detach re-attach to move the data and log files. I can not get...

OLE DB provider "SQLNCLI10" for linked server "XXX" returned message "The partner transaction manager has disabled its support for remote/network transactions.". - Hi, I have two SQL Servers Server A and Server B. ServerA has SQL Server 2008 and ServerB has SQL Server...

SQL Server Buffer Manager Free Pages - I'm setting up some alerts using the Performance Monitor counters and there is one I'm really struggling to find much...


SQL Server 2005 : SQL Server 2005 Performance Tuning

Table partitioning and MAX queries performance problem - Hi All, Just implemented partitioning in SQL Server 2005. Which should be a great tool for better flexibility and performance. However...


SQL Server 2005 : SQL Server 2005 Integration Services

Error 0XC0048000 when running a SSIS package via SQL Server Agent - I have a SQL Server Agent job that runs a SSIS package via the File System rather than Integration Services,...

Overwriting Excel File with SSIS package - Hi All, I have an SSIS package which exports the data to an Excel file using Excel Destination component. Could any...


SQL Server 7,2000 : T-SQL

help me to select ROW_NUMBER in sql server 2000 - [size="4"][i][b]help me to select ROW_NUMBER in sql server 2000[/b][/i][/size]

This email has been sent to newsletter@newslettercollector.com. 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 ©2015 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com