In this issue

Featured Contents

Editorial

Featured Script

 
 advertisement
 
SQL DBA Bundle ‘Six Scary SQL Surprises’
Brent Ozar joins the DBA Team, for Lesson 3 of their ‘Top 5 Hard-earned Lessons’. Gain valuable tips from the pros - Read now
 
SQL Compare Compare and sync databases with SQL Compare
“SQL Compare is fast, extremely easy to use, full-featured and affordable. I wouldn't bother messing around with anything else.” Adam Machanic, SQL Server MVP. Download a 14-day free trial.
 
SQL Backup Pro "Cut the backup time by hours and the file size by 80%" Hazel Cawood, Systems Analyst
Find out how much time and space you can save with SQL Backup Pro. Get compressed, encrypted and fully verified backups. Download a free trial now.

In This Issue

Stairway to SQL Server Indexes: Level 1, Introduction to Indexes

Indexes are the database objects that enable SQL Server to satisfy each data access request from a client application with the minimum amount of effort, resulting in the maximum performance of individual requests while also reducing the impact of one request upon another. Prerequisites: Familiarity with the following relational database concepts: Table, row, primary key, foreign key More »


New Custom Metric: Long Running Job

SQL Monitor’s Job duration unusual alert is a powerful tool for keeping track of most jobs in your SQL Server environment. It works by comparing the running time of any job instance against the median for that job, and identifying when a variation in the job duration could hint at a performance problem. However, if your environment contains big jobs whose durations vary by several orders of magnitudes, it can be tricky to specify what kind of variation is expected and what would be unusual. For these cases, it is possible to go beyond the functionality of the built-in alert with a custom metric. More »


Generating Sequence Numbers Using the Sequence Object

The new SQL Server 2012 Sequence Object can be used to generate unique numbers that can be automatically incremented based on an increment value. Greg Larsen discusses the different features of the sequence object and how you can use it to generate sequence numbers. More »


From the SQLServerCentral Blogs - The Great Laptop Search of 2013

It’s time for a new laptop. I don’t think it’s time, as I love the Macbook Air I bought a... More »


From the SQLServerCentral Blogs - Security: People Are the Weakest Link

There was an interesting conversation on Twitter today about security awareness and why the training so often fails. From my perspective, here's... More »


Editorial - Insensitivity: A Good Technique?

Today we have a guest editorial from Bill Nicolich as Steve Jones is traveling.

Often when I hear discussions about emotion at work, particularly from management but also from colleagues that inhabit aggressive roles, the message is that emotions are part of the problem, and they should be set aside. They don't do knowledge workers any good. In fact, it often stands in the way of more options and making needed changes.

Perhaps we can take a cue from working with compilers. The compiler doesn't give one rip about our feelings. If there's any errors of syntax that it can find, it sends us the feedback: ERROR. End of story. No whining, sniveling, gnashing will persuade the compiler to appreciate the work we've done. The compiler is such a wonderful thing. It's so efficient and always tells a kind of truth. Maybe, some think, we should become more like a compiler.

I shouldn't say that emotions are completely frowned upon. There are some emotional keys in the register that are openly encouraged. People are encouraged to find enthusiasm for new technologies, for learning new ways of doing things, for getting corrected, for delivering on time and on budget - and so forth.

But when I step back and look at the register of emotions that the pressures of software development tends to encourage - it doesn't look right to me. In fact, it almost looks like an absurd exercise of trying to make people inhuman. I think it's time to take a look at what emotions are and gain some perspective.

For that I turn to a philosopher, Robert C. Solomon who has done more thining about emotions then most people have. His book "The Passions: Emotions and the Meaning of Life" contains some nice quotes that I'll refer to.

At times I witness a colleage assuming a completely stoic expression, making a suggestion that runs all over the opinions and mental commitments of a variety of people, and somehow this cutting to the chase of what should be done is viewed as bold, heroic and refreshing. What it reminds me of is sort of a passionless "suffocation of the soul by which that withered and joyless imposter that so often passes as 'wisdom'" shows itself in the workplace (Solomon).

In arguing to regain the full register of human emotions, I have the definitions of what it is to be human on my side. I'll turn the table and suggest that what is absurd is to try to make humans something other than human. As a species, along with the other social species that can be observed at the zoo or out in the wild, we have a broad register of emotions and we are territorial. Sure, territorial behavior in knowledge work can get out of hand and become a problem, but that's true with any key in the emotional register. Any emotion can become pathological. That doesn't call for the complete expulsion of the emotion, but the harnessing of it.

My next argument is from Solomon where he claims that emotions are so intwined with the evaluative judgments which they are associated with that they become indistinguishable - and that in a real sense, emotions are judgments that we make about the world and our place in it.

Knowledge work, and software development in particular, is at the core, all about making good judgments - about what moves to make given the changing circumstances, challenges and opportunities in front of us. If you'll allow that emotions stem from the same basis as reason - in that they are also a form of judgment - then it becomes clear that their complete removal is unwarranted if not absurd.

Another way to state this comes from Solomon: "It's often said in philosophy and elsewhere that reason must rule the passions; ... To divide the human soul into reason and passion, setting one against the other in a struggle for control, one to be the master and one to be the slave, divides us against ourselves, forcing us to each be defensively half a person, instead of a harmonious whole ... There is no different 'faculties,' only differences in scope and perspective (between reason and the passions)."

Coming from a complementary but slightly different angle is Robert Frank who argues that emotions are a form of commitment. A dog stares us down with an aggressive attitude - and even though we don't speak dog - we get the message clearly that the dog is committed to aggression if we invade its territory. So we too show that we truly are committed to various relationships and various causes through our emotions. Really, this goes to explaining why any of the species have a register of emotions in the first place - and why they are intertwined with communication. Often commitments just need some acknowledgement.

Let's evaluate this notion of insensitivity as a good technique. Decision-makers can wield insensitivity toward people's emotions and perhaps get a change to happen more quickly - and then this technique gets reinforced. But to the extent that people have choices about who to work with and where to work, why wouldn't they choose to work in places that are more courteous and understanding of their commitments and judgments?

We're learning that people work hardest for a cause. That's emotion. If an environment deals damage to a person's self concept or emotional register, what will that do to motivation and commitment?

On the side of managers and decision-makers, I think they are better off under the exercise of negotiating with real humans - because they will get a chance to exercise and further develop social maturity, emotional intelligence and the like. If they skirt the exercise, will they not atrophy?

So-called "benevolent dictators" and decision-makers in knowledge work environments should exercise common courtesy, respect and sensitivity more often and that as a whole, the industry has moved too far to one side of that false dichotamy between reason and the passions.

This is just one of the many indicators that software development is a young profession and that emotional intelligence and maturity is critical among all the various roles involved.

The ideal of team-based design work is not to set up a vacuum devoid of emotions. That is an inherently evasive approach of avoiding conflicts and responsibilities. The ideal is to get better at managing the collisions and differences of judgments among people through a maturing process and all the while making an environment where people feel understood and appreciated.

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

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


Question of the Day

Today's Question:

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

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

This question is worth 1 point in this category: Resource Governor. 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.

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.


Yesterday's Question of the Day

-- Create Table1
CREATE TABLE Table1
(ID INT, Value VARCHAR(10), Flag INT)
GO
INSERT INTO Table1 (ID, Value, Flag)
SELECT 1, 'First', 1
UNION ALL
SELECT 2, 'Second', 1
UNION ALL
SELECT 3, 'Third', 2
UNION ALL
SELECT 4, 'Fourth', 1
UNION ALL
SELECT 5, 'Fifth', 2
UNION ALL
SELECT 6, 'Sixth', 1
UNION ALL
SELECT 7, 'Seventh', 2
GO

-- Create Table2
CREATE TABLE Table2
(ID INT, Value VARCHAR(10), Flag INT)
GO
-- Populate Table2
INSERT INTO Table2 (ID, Value, Flag)
SELECT 1, 'First', 1
UNION ALL
SELECT 2, 'Second', 1
UNION ALL
SELECT 3, 'Third', 2
UNION ALL
SELECT 8, 'Eighth', 1
UNION ALL
SELECT 9, 'Ninth', 2
GO

What will be the output of these queries?

--Query 1
SELECT 
 * 
 FROM table1 t1
  LEFT JOIN table2 t2 
   on t1.id = t2.id AND t1.flag = 1

--Query 2
SELECT
 * 
 FROM table1 t1
  LEFT JOIN table2 t2 
   on t1.id = t2.id
 WHERE t2.flag = 1

Answer: Query 1 return all rows of table 2 where Flag =1 with all rows of table 1 while Query 2 only return rows from table 1 and table 2 where FLAG = 1

Explanation: The ON clause it is apply before JOIN that is why it retrieves all the result of Table2 where there are Flag = 1 but it does not affect Table1 so it retrieves all the rows of table1. When WHERE clause is applied it applies to complete result so it removes all the rows from Table1 and Table2 where Flag is not equal to 1, essentially keeping flag = 1 rows from Table1 and Table2.

Ref: http://msdn.microsoft.com/en-us/library/ms187518%28v=SQL.105%29.aspx

» 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

Automate Test Database Restoration

Automate test database restorations from your production system. 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

Query Multiple Databases - 04/04/2013 I am a newbe database admin and I have been tasked to run queries against multiple databases. Each server has...

How to create explain in sql - explain for as select statement.... explain for select * from employees we also provide oracle,sql training http://oracletrainingpune.blogspot.in

What is Pending Request Registry - Hi All, What is Pending Request Registry? Thanks in advance!!

File group is running out of space - Hi, I am getting below specified running out space alert even autogrowth option is enabled and disk got enough space. Alert message...

Exporting SQL Server configuration - We are in process of building a new Server for our SQL 2005. The current SQL Server 2005 , we made few...

sql server agent jobs - Can anyone tell me how can i copy the sql server agent jobs easily from production to test server without...

Getting an error "Exception of type 'System.OutOfMemoryException' was thrown." during stored procedure execution - Hi I am running a stored procedure that have lacs of select command but query is showing this error. "An error occurred...

SQL Server 2005 : Business Intelligence

Timeout in SSIS - Hi, I have developed a SSIS package in which it contains one execute SQL task,data flow task for retrieving data from...

SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER - I have created an SSIS package to copy the data from an Oracle database to SQL Server 2005. the package...

SQL Server 2005 : SQL Server 2005 General Discussion

Unable to Send Mails through Database Mail - Hello All, We are having MS SQL 2005 in our server and our organization mainiting Two types of E-Mail - Internal & External. Internal...

Query help - I have a table as below. It has list of tasks with its start date and end date. When a...

List Files In Directory Using SQL - Hi All, I hope this makes sense, lets say i have folder a and folder b. Within Folder A I have...

SQL Server 2005 : SQL Server 2005 Security

Error logging in...The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception - Hello - I have a SQL Server instance that I am only able to get to from my local installation of...

SQL Server 2005 : SQL Server 2005 Strategies

Moving prod DBs from local disk to SAN with absolute minimal downtime - [b][u]Background[/u][/b] I have a number of production databases that are currently on the local disk on the server. We have recently...

SQL Server 2005 : SQL Server Express

Unspecified error MS visual database tools - Hi, i am using sql server management studio 2005 express, and every time i try to open a table in...

SQL Server 2005 : SQL Server 2005 Integration Services

Data Migration with SSIS in multiple steps - I am new to SSIS. I am planning to use SSIS for data migration. I have a big source table (record...

IS_OFF (BUF_MINLOGGED, m_buf->bstat) || pageModifyType != PageModifyType_Contents || GetPagePtr ()->IsTextPage () - Job fails with following error. Any help is appreciated. Executed as user: xxx Microsoft (R) SQL Server Execute Package Utility Version...

SQL Server 2005 : T-SQL (SS2K5)

I need answer for this can anyone help me with this - Declare @CurStudent cursor Declare @Name VARCHAR(100) Declare @Dept_ID INT Declare @Department VARCHAR(100) Declare @Fees NUMERIC(10,4) Declare @StudentStatus varchar(100) Declare @DOJ DATETIME CREATE table #tempTable(TempName VARCHAR(100), TempDept_ID INT,TempDepartment...

userdefined function for average - Hi guys, I tried to create a new userdefined function for calculating the average of top 10 values on different columns...

Query Help Please! - 2 Tables. Table C VISIT#, SSN, FACILITY, DOCUMENT NAME Table H VISIT#, SSN, DATE Visit# | SSN | DOCNAME | DATE 1 | 555 | Doc A | 01.01.01 1 | 555 | Doc B...

how to verify blank spaces using substr function in SQLSERVER 2008 - I am new to SQL SERVER 2008, trying to explore T-SQL I am trying to split a sentence into words using...

Java dynamically builds SQL - I was assigned to convert Java code with embedded SQL to stored procedures. The plan is to remodel database (tables and...

Query to retrieve a column depending on variable value? - Hi guys, I have a problema that I can't find a clue to face it: The situation: I have three different tables...

How to get user roles - When a user logs into my application, I would like to see which DB roles are assigned to that user....

SQL Server 2005 : SQL Server Newbies

create table to group th e people of same department - NAME AGE SALARY DEPARTMENT SHARATH 24 21000 MARKETING RATHAN 35 21000 MARKETING RATS 28 21000 IT DARSHAN 23 20000 IT LINI 25 25000 IT SHAN 23 20000 MARKETING SUDARSHAN 22 20000 IT to above given table i wan to write a qury that display IT MARKETING RATS RATHAN DARSHAN SHARATH LINI SHAN

SQL Server 7,2000 : T-SQL

XML Data Extract - I would appreciate if any one can help me extracting the data in to SQL server from the the following...

SQL Server 2008 : SQL Server 2008 - General

SQL query help - hey guys need some help with a query!!! basically i have a table that has a list of learner with a number...

Char(9) to Time - Hey, I have a column that's char(9) and effectively stores time. This is a sample of the data; 0 02:19 -03:06 00:22 ...

Grouping field in alphabetical order not in order needed - Hello, I have a field called Priority that I am using in a report. The field has 6 possible entries, Top...

SSRS email report depending on report field - Hi I have a simple SSRS report with list of users and one of the fields has their email address. I want...

Fulltext for multiple word - Hi, I want to replace below query using fulltext Contain select * from tx_Main_Data MD where Column1 like '%This is for testing purpose%' But...

Grouping question - I have the following data: File Description Points 1001- Industrial 100 1001-001 Barker 200 1001-002 Curry 175 1002- Buildings 375 1003- HVAC 225 1003-001 Wing School...

how to write query for multiple columns in select and in group by only 1 column - Hello all My requirement is how to write query for multiple columns in select and in group by only 1 column....

How to Seperate number from a text - Hi, Here is my scenario, i have set a data in my column SBA 60 OFF 19.99 NOW 7.99 SBA 50 OFF 99.99...

Problem Measure Calculated dynamically (error #VALUE!) - Hello, I have a problem to calculate the variance. Here is the code I use: Axis([Measures]).item(0)-Axis([Measures]).item(1) Dynamically, the calculated measure makes the subtraction between...

Getting a specific column name - I am trying to get the name of a column from a table from a specific value. For example, table1 row...

Linked server - I created a linked server in ServerA to ServerB but another user created linked server in ServerB to ServerA. Does...

How to change the report server log directory - Hi, I did the change in the config file found at at C:\Program Files\Microsoft SQL Server\MSRS10_50.XXX\Reporting Services\ReportServer\bin. By Default logs is created...

Including null complex type elements in XML output - Given two entities, mortgage and customer, each in a table and a third table linking customers to mortgages, I need...

Sql Server 2008 Generate Script Process - Hi, I have a questions with regards to using Sql Server 2008 to automatically script out sql server objects. If I right-click...

Converting to Float in ssis - I'm exporting Flat File to DB Table. In Flat File I have numeric column with some values has empty space. In Derived...

oracle 9i to Sql server 2008 R2 migration - Hi, We are having oracle 9i as database and migrating to sql server 2008. Our oracle 9i database connects to another oracle...

How to write custom query which shows last two records added only. - For Insurance where logic is something like after renewing a policy that renewed policy is current policy and previous policy...

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

Parallel Thread Deadlocks Help? - Trace Flag 1222 enabled Profiler Captured Database Tuning Adviser I’m believe I’m getting “Intra-Query Parallel Thread Deadlocks” and not really sure how to...

SQL migration - Whats the best way to copy logins, users, logins with password along with exact status of enable/disable from source 2008...

tricky many to many query - I have a complex query to put together and need some help. I have a table like the one below...

SSRS MHTML formatting problem when using gmail - Hello... I'm not finding any resolutions to a problem that many seem to be running into. Google searches are turning up...

Issue: Index creation is not running in parallel - I have a customer who has a SQL Server 2008 R2 Enterprise Edition clustered instance. The instance is configured with...

Differences between sql server 2008 and 2008 R2 - I did some research to find the differences between between sql server 2008 and 2008 R2 but couldnt find much....

SQL Server 2008 : T-SQL (SS2K8)

Function for similar phrases - Hi All, Is there any built in function available for checking the similarity of the phrases eg: US Eastern District Court...

Column name or number of supplied values? - Hi, what is wrong in my coding? I want monitor some time interval for IO pending task witing in queue.. Error: Msg 213,...

Odd behaviour from sys.dependencies - (SQL Server 2008 R2 SP1) Hi all, I have an SSIS package that dynamically builds a set of SQL statements based...

CTE - Temp table - CROSS APPLY - I had some free time at work and was trying out some silly queries when I came across this. CTE referenced...

CHAR(10) sometimes work - IN SQL I want to print for example [quote]Ali is going to Alex[/quote] so I said [quote]declare @x varchar(max) set @x = 'Ali' + CHAR(10) + 'is...

retrieve records by joining history table - HI, Can you help me with the query. Thanks for any help. The below is the example scenario: Master_table pk status_date status amount 1...

Diff b/w Temp tables varibles and CTE's - Hi guys i have a doubt abut temp table and CT E's which one is faster and why,in which sceniro we...

Selection using date held as a string - In our database we have a parameters table that holds a parameter type (e.g. D for date, N for number,...

HierarchyID performance problems... Really??? - I heard tales of performance problems associated with the HierarchyID datatype in SQL Server 2008. Since I haven't actually used...

SQL Server 2008 : Working with Oracle

Need better solution to Import from Oracle - I maintain BI that needs to import the data from Oracle every day. I use the import wizard to create...

SQL Server 2008 : SQL Server Newbies

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

how to find owner(SPID) of the temp tables - Dear All In temp db i find many temp tables created. I would like to know which SPID has created these....

Importing data via ODBC (from mozaic) to SQL - Good Day Ladies/Gents I was wondering how I would go about importing data from a data source (mozaic) in the same...

SQL Server 2008 : Security (SS2K8)

Non-sysadmin needs ability to maintain SQL Agent Jobs - We have a team member that does not have sysadmin but we would like to give this person the ability...

Prevent DDL Triggers from disabling - Hi friends , Here i am having SQL Server 2008 R2 Standard Edition . To Control the Schema level Changes, i have...

SQL Server 2008 : SQL Server 2008 High Availability

Do I have to pay for Microsoft's support? - Yesterday was a long day for me. My SQL2012 Cluster went down and the root cause was the iSCSI initiator...

multiple instance sql cluster with different windows configuration - We have a two node cluster. In order to utilize the max resources we are planning to add more instances...

Is SAN admin correct? Windows 500 GB limitation on cluster failover? - Hello I was recently pulled into an ongoing project that is running into problems. The old project manager let me know...

SQL Server 2008 : SQL Server 2008 Administration

Encrypted File system(EFS) in sql Server 2008 - Hi, how can i impleted EFS in sql level user in sql server 2008r2..?is it possiable please help me..

Performance troubleshooting - We have a department who has a couple of SQL servers,they said there sometimes maybe disk I/O issues. That is...

Logical CPU Count and Hyperthread Ratio ? - Hi, The query output as below [code="sql"]SELECT cpu_count AS [Logical CPU Count], hyperthread_ratio AS [Hyperthread Ratio],cpu_count/hyperthread_ratio AS [Physical CPU Count], physical_memory_in_bytes/1048576 AS...

Entering Service Account Details During Install - I read an article posted by GilaMonster about remedies for some errors preventing SQL from starting. One section was on the...

Primary file group out of space - If the primary file group runs out of space and its file growth is restricted, and if the table exists...

Reset Index Usage Counters - Hello, is it possible to reset the Index Usage counters like user_seeks,user_scans,user_lookups etc etc on a [i]production [/i] server without...

Rebuild system database failure - I have a situation where all system database (.mdf, .ldf) were wiped out after system recovery from a major outage....

Career : Certification

Failed 70-462. Worth doing 70-461 before resit? - Took 462 yesterday and only managed to get 612 vs the pass mark of 700. Main problem is that I'm...

Career : Resumes and Job Hunters

Have a job offer from US - I am looking forward to get a job in the USA. And I don't have residence permit. May be anyone have...

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

Baseball Statistics - Does anybody have an Access database, or SQL Server database that has been created to house baseball statistics ?

SQLServerCentral.com : SQLServerCentral.com Website Issues

Why are some pages so W-I-D-E ?? - Why are some of the pages so incredibly wide? My screen resolution is set to 1280 x 1024 and some...

Reporting Services : Reporting Services

How to set a particular printer in reportviewer code c# - Hi, we have a requirement where one of our departments needs to annually select a variable number assets for revaluation,...

Combining Security Roles - Hello - I would like to get confirmation on something. I think I already know the answer but I need to...

Trying to get SSRS 2005 reports to work on a user's machine - We've been replacing or upgrading users' machines from Windows XP to Windows 7. After doing that one of the users...

?? on =count adding a "When" - using this expression on a total in a matrix =count(Fields!xmark.Value) can I add a condition onto this so it only counts...

code to multiply dose by times administered - Hey Guys I have to create a report which shows how many times a drug was administered and the dose is...

Basic CASE Statement in Cascading parameterized report - Hi All, Writing a small CASE statement that in SQL Server. Below is what I'm try to accomplish. If the user selects...

Unable to create a working indicator - I am trying to create an (Shape) indicator for a SSRS report whereby the indicator will turn red if there...

Hide Duplicate rows - I am creating a report based on a group value and hiding the duplicate values by clicking the hide property on the selected...

Data Warehousing : Integration Services

Deployment and Execution of packages - Hey all. I am hoping to pull upon the collective genius that frequent these forums, because I am drawing a...

Determine which columns should be updated during an incremental load - Hi Folks, I have the following Scenario: I receive customer data every day from an external Company over an ETL process....

Version history extraction from SharePoint - Hi, I am wondering how do I go about extracting version history from SharePoint using SSIS. Thank you, Darragh

Data Warehousing : Analysis Services

Problem Measure Calculated dynamically (error #VALUE!) - Hello, I have a problem to calculate the variance. Here is the code I use: Axis([Measures]).item(0)-Axis([Measures]).item(1) Dynamically, the calculated measure makes the subtraction between...

Login failed for user 'NT Service\MSSQLServerOLAPService' 28000 - I am using SQL Server 2012 developer edition on Windows 7. I have the following error attempting to process a...