RUP in short

June 17, 2007

The Rational Unified Process (RUP) consists of four phases: Inception, Elaboration, Construction and Transition. At last count however, RUP also consisted of: 9 core workflows, 31 workers, 103 artifacts, 136 activities, plus more guidelines, checklists and tool mentors than you would care to count.


Data mining

June 17, 2007

Exploring and analyzing detailed business transactions. It implies “digging through tons of data” to uncover patterns and relationships contained within the business activity and history. Data mining can be done manually by slicing and dicing the data until a pattern becomes obvious. Or, it can be done with programs that analyze the data automatically. Data mining has become an important part of customer relationship management (CRM). In order to better understand customer behavior and preferences, businesses use data mining to wade through the huge amounts of information gathered via the Web

The goal of this credit card analysis is to determine the most influential factors common to non-profitable customers. In this case, BusinessMiner from Business Objects determined that the credit limit had the greatest effect on profitability and prioritized the results in graphical form.

SOURCE:
http://www.answers.com/topic/data-mining

——————————————————————————-

VERY GOOD ARTICLE

November 2003 (Vol. 36, No. 11) pp. 22-29
Data Mining for Very Busy People
Tim Menzies, West Virginia University
Ying Hu, University of British Columbia

Abstract
Most modern businesses can access mountains of data electronically—the trick is effectively using that data. In practice, this means summarizing large data sets to find the data that really matters. Most data miners are zealous hunters seeking detailed summaries and generating extensive and lengthy descriptions. The authors take a different approach and assume that busy people don’t need—or can’t use—complex models. Rather, they want only the data they need to achieve the most benefits.Instead of finding extensive descriptions of things, their data mining tool hunts for a minimal difference set between things because they believe a list of essential differences is easier to read and understand than detailed descriptions.

From Wikipedia, the free encyclopedia

In it, the authors make the argument that accessing data is not the problem for the data mining community – the problem is ignoring the irrelevant data. The angle presented is to search large data sets to find the smallest subset of the most relevant data. According to the authors, the approach of “learning the least” as applied to some data set is a departure from the norm – they state that most data miners are typically concerned with discovering a data summary with fine-grained details.

The authors describe the TAR2 treatment learner, a data mining tool that searches for “the minimal difference set between things.” It is claimed that TAR2 produces data models that are simpler to understand by humans, because the models are presented as a list of essential differences instead of a highly detailed summary.

The TAR2 treatment learner, which is available at http://menzies.us/rx.html, takes a large amount of data and creates a few simple rules instead of the complex tree produced by many data miners. It uses the three major concepts of treatment learning: lift, minimum best support, and the small treatment effect.

What the authors claim TAR2 has to offer over other treatment learners is the use of superior heuristics in finding data treatments. The TAR2 uses three key heuristic tricks. First, TAR2 chunks continuous attributes into separate bins of values. For example, instead of having a range of continuous values, the data would instead be separated into small values, medium values, and high values. Second, TAR2 assumes the small treatment effect and always deals with a small number of attributes. Finally, the TAR2 looks only at treatments with high ranges. It assumes that people are only interested in seeing positive results.

To support their claims of being able to derive simplified and more representative models for large data sets, the authors present three case studies in the domains of software risk estimation, software inspection policies, and requirements engineering.

Menzies and Hu apply the TAR2 treatment learner to several data sets in these domains, and demonstrate improved results using their methods.

Data mining and treatment learning
The article also includes a sidebar in which Menzies and Hu also describe some of the common methods used in both data mining and treatment learning. These include decision tree learning, association rule learning, wrappers, genetic algorithms, and simulated annealing algorithms.

———————————————————————————-

http://en.wikipedia.org/wiki/Data_mining

Data mining is an innovative way of gaining new and valuable business insights by analyzing the information held in your company database. These insights can enable you to identify market niches, and they support and facilitate the making of well-informed business decisions. Essentially, data mining is a groundbreaking way to leverage the information that your company already has in order to plan a business strategy for the future.

Data mining uncovers this in-depth business intelligence by using advanced analytical and modeling techniques. With data mining, you can ask far more sophisticated questions of your data than you can with conventional querying methods. The information that data mining provides can lead to an immense improvement in the quality and dependability of business decision-making.

————————————————————————————-

Data Mining, also known as Knowledge-Discovery in Databases (KDD), is the process of automatically searching large volumes of data for patterns. Data Mining is a fairly recent and contemporary topic in computing. However, Data Mining applies many older computational techniques from statistics, machine learning and pattern recognition.

Definition
Data Mining can be defined as “The nontrivial extraction of implicit, previously unknown, and potentially useful information from data” [1] and “The science of extracting useful information from large data sets or databases” [2]. Although it is usually used in relation to analysis of data, data mining, like artificial intelligence, is an umbrella term and is used with varied meaning in a wide range of contexts. It is usually associated with a business or other organization’s need to identify trends. Data mining involves the process of analysing data to show patterns or relationships; sorting through large amounts of data; and picking out pieces of relative information or patterns that occur e.g., picking out statistical information from some data

A simple example of data mining is its use in a retail sales department. If a store tracks the purchases of a customer and notices that a customer buys a lot of silk shirts, the data mining system will make a correlation between that customer and silk shirts. The sales department will look at that information and may begin direct mail marketing of silk shirts to that customer, or it may alternatively attempt to get the customer to buy a wider range of products. In this case, the data mining system used by the retail store discovered new information about the customer that was previously unknown to the company. Another widely used (though hypothetical) example is that of a very large North American chain of supermarkets. Through intensive analysis of the transactions and the goods bought over a period of time, analysts found that beers and diapers were often bought together. Though explaining this interrelation might be difficult, taking advantage of it, on the other hand, should not be hard (e.g. placing the high-profit diapers next to the high-profit beers). This technique is often referred to as Market Basket Analysis.

In statistical analyses, in which there is no underlying theoretical model, data mining is often approximated via stepwise regression methods wherein the space of 2k possible relationships between a single outcome variable and k potential explanatory variables is smartly searched. With the advent of parallel computing, it became possible (when k is less than approximately 40) to examine all 2k models. This procedure is called all subsets or exhaustive regression. Some of the first applications of exhaustive regression involved the study of plant data.[3]

Data dredging
Used in the technical context of data warehousing and analysis, the term “data mining” is neutral. However, it sometimes has a more pejorative usage that implies imposing patterns (and particularly causal relationships) on data where none exist. This imposition of irrelevant, misleading or trivial attribute correlation is more properly criticized as “data dredging” in the statistical literature. Another term for this misuse of statistics is data fishing.

Used in this latter sense, data dredging implies scanning the data for any relationships, and then when one is found coming up with an interesting explanation. (This is also referred to as “overfitting the model”.) The problem is that large data sets invariably happen to have some exciting relationships peculiar to that data. Therefore any conclusions reached are likely to be highly suspect. In spite of this, some exploratory data work is always required in any applied statistical analysis to get a feel for the data, so sometimes the line between good statistical practice and data dredging is less than clear.

One common approach to evaluating the fitness of a model generated via data mining techniques is called cross validation. Cross validation is a technique that produces an estimate of generalization error based on resampling. In simple terms, the general idea behind cross validation is that dividing the data into two or or more separate data subsets allows one subset to be used to evaluate the generalizeability of the model learned from the other data subset(s). A data subset used to build a model is called a training set; the evaluation data subset is called the test set. Common cross validation techniques include the holdout method, k-fold cross validation, and the leave-one-out method.

Another pitfall of using data mining is that it may lead to discovering correlations that may not exist. “There have always been a considerable number of people who busy themselves examining the last thousand numbers which have appeared on a roulette wheel, in search of some repeating pattern. Sadly enough, they have usually found it.” [4]. However, when properly done, determining correlations in investment analysis has proven to be very profitable for statistical arbitrage operations (such as pairs trading strategies), and furthermore correlation analysis has shown to be very useful in risk management. Indeed, finding correlations in the financial markets, when done properly, is not the same as finding false patterns in roulette wheels.

Most data mining efforts are focused on developing highly detailed models of some large data set. Other researchers have described an alternate method that involves finding the minimal differences between elements in a data set, with the goal of developing simpler models that represent relevant data. [5]

Privacy concerns
There are also privacy concerns associated with data mining – specifically regarding the source of the data analyzed. For example, if an employer has access to medical records, they may screen out people who have diabetes or have had a heart attack. Screening out such employees will cut costs for insurance, but it creates ethical and legal problems.

Data mining government or commercial data sets for national security or law enforcement purposes has also raised privacy concerns. [6]

There are many legitimate uses of data mining. For example, a database of prescription drugs taken by a group of people could be used to find combinations of drugs exhibiting harmful interactions. Since any particular combination may occur in only 1 out of 1000 people, a great deal of data would need to be examined to discover such an interaction. A project involving pharmacies could reduce the number of drug reactions and potentially save lives. Unfortunately, there is also a huge potential for abuse of such a database.

Essentially, data mining gives information that would not be available otherwise. It must be properly interpreted to be useful. When the data collected involves individual people, there are many questions concerning privacy, legality, and ethics.

Combinatorial game data mining
Data mining from combinatorial game oracles:
Since the early 1990s, with the availability of oracles for certain combinatorial games, also called tablebases (e.g. for 3×3-chess) with any beginning configuration, small-board dots-and-boxes, small-board-hex, and certain endgames in chess, dots-and-boxes, and hex; a new area for data mining has been opened up. This is the extraction of human-usable strategies from these oracles. This is pattern-recognition at too high an abstraction for known Statistical Pattern Recognition algorithms or any other algorithmic approaches to be applied: at least, no one knows how to do it yet (as of January 2005). The method used is the full force of Scientific Method: extensive experimentation with the tablebases combined with intensive study of tablebase-answers to well designed problems, combined with knowledge of prior art i.e. pre-tablebase knowledge, leading to flashes of insight. Berlekamp in dots-and-boxes etc. and John Nunn in chess endgames are notable examples of people doing this work, though they were not and are not involved in tablebase generation.

Notable uses of data mining
Data mining has been cited as the method by which the U.S. Army unit Able Danger supposedly had identified the 9/11 attack leader, Mohamed Atta, and three other 9/11 hijackers as possible members of an al Qaeda cell operating in the U.S. more than a year before the attack.
See also: Able Danger, wikinews:U.S. Army intelligence had detected 9/11 terrorists year before, says officer.
As is the case for economic models which successfully predict 10 of the last 3 recessions, one must of course know which other names came up on the “possible members” list before being confident this was not an exercise in data dredging.


Course 2937: Administering and Monitoring Microsoft® SQL Server™ 2005

June 17, 2007

Course 2937: Administering and Monitoring Microsoft® SQL Server™ 2005

Overview of the sqlcmd UtilityIt is not always possible, or desirable, to use a graphical tool such as SQL Server Management Studio for executing Transact-SQL statements. For example, batch scripts scheduled for unattended execution do not usually operate in a graphical environment. SQL Server 2005 includes a utility called sqlcmd to facilitate this requirement.Definition
The sqlcmd utility allows you to execute Transact-SQL statements and scripts from the command prompt and schedule batch jobs. This utility uses OLE DB to run Transact-SQL batches. Previous SQL Server utilities used ODBC or DB-Library.

Important
Although SQL Server 2005 provides both sqlcmd and osql, osql will not be supported in future versions of SQL Server. You should use sqlcmd for all new development.

sqlcmd enhancements
The sqlcmd utility extends the features found in osql, including the ability to use variables, connect to servers dynamically, query server information, and pass error information back to the calling environment. It also provides a Dedicated Administrator Connection (DAC) that allows a database administrator to connect to the server and resolve problems.

The sqlcmd utility supports the following commands in addition to Transact-SQL statements.

Command Description
GO [count]
Execute the command batch the specified number of times (default is once).

RESET
Clear the statement cache.

ED
Invoke the text editor over the most recent batch. The environment variable SQLCMDEDITOR specifies the editor to use (edit.com by default).

!! cmd
Execute the specified operating system command and return to the sqlcmd utility.

QUIT
Exit the sqlcmd utility.

EXIT (statement)
Exit the sqlcmd utility but pass the first value returned by the specified statement to the calling environment as the exit code.

The following commands all require a colon prefix (:)

Command Description
:r filename
Read the contents of the specified file into the statement buffer.

:ServerList
List all available computers in the network running SQL Server on the network.

:List
Display the contents of the statement cache.

:Listvar
Display the scripting variables and values that are currently set.

:Error filename | STDOUT | STDERR
Redirect all error output to the specified file, the standard output stream, or the standard error stream.

:Out filename | STDOUT | STDERR
Redirect all query results to the specified file, the standard output stream, or the standard error stream.

:P erftrace filename | STDOUT | STDERR
Redirect all performance trace information to the specified file, the standard output stream, or the standard error stream.

:Connect server[\instance] [timeout] [user_name[password]]
Connect to the specified server and instance using the supplied username and password. Time out if the server does not respond in the specified number of second. Default values for the connection parameters can be specified in the SQLCMDLOGINTIMEOUT, SQLCMDSERVER, SQLCMDUSER, and SQLCMDPASSWORD environment variables.

:On Error [exit | ignore]
Specify an action to be performed when an error occurs during command execution. The exit option quits the sqlcmd utility with an error. The ignore option displays an error message but the script will continue.

:SetVar variable value
Create or set a scripting variable with the specified value.

:Help
List sqlcmd commands with a short description of each.

Sqlcmd command-line switches

The following table describes the sqlcmd command-line switches. Many of these options are primarily useful when running sqlcmd as part of a non-interactive batch job.

Switch Description
-?
Display the syntax summary of sqlcmd options.

-L[c]
List the server computers available on the network. If the c option is specified, the list is displayed without a heading.

This switch cannot be used in conjunction with other switches.

-U login_id [-P password]
Connect using the specified SQL Server 2005 login user name and password.

If these switches are omitted, sqlcmd will attempt to connect using Windows Authentication as the account running the sqlcmd utility. Alternatively, the user name and password can be specified in the sqlcmd and SQLCMDPASSWORD environment variables.

-E
Connect using Windows Authentication. (This is the default if the -U and -P switches are omitted.)

-S server_name[\instance_name]
Specify the server and instance to connect to. This information can also be specified in the SQLCMDSERVER environment variable.

-H wksta_name
The workstation name displayed by the sp_who stored procedure and the Activity Monitor in SQL Server Management Studio. The default value is the name of the computer being used to run the sqlcmd utility. This information can also be specified in the SQLCMDWORKSTATION environment variable.

-d db_name
The database to connect to. This information can also be specified in the SQLCMDDBNAME environment variable.

-l time_out
The number of seconds before the login to the OLE DB provider times out. The default is eight seconds. This information can also be specified in the SQLCMDLOGINTIMEOUT environment variable.

-t time_out
The number of seconds before a command or SQL statement times out. By default, commands do not time out. This information can also be specified in the SQLCMDSTATTIMEOUT environment variable.

-h headers
The number of rows to be printed between column headings. By default, column headings only appear once, at the start of a result set. Use –h-1 to indicate that column headings should not be displayed. This information can also be specified in the SQLCMDHEADERS environment variable.

-s col_separator
The column separator character to use. By default, the sqlcmd utility uses a blank space. This value can also be specified in the SQLCMDCOLSEP environment variable.

-w column_width
The output screen width. The default value is 80. This value can also be specified in the SQLCMDCOLWIDTH environment variable.

-a packet_size
Request that communications with SQL Server use the specified packet size. This information can also be specified in the SQLCMDPACKETSIZE environment variable.

-e
Echo input.

-I
Enable the QUOTED_IDENTIFIER connection option.

-c cmd_end
The batch terminator to use. By default, this is the word GO on a line by itself. Do not use a Transact-SQL reserved word.

-q “query”
Execute the specified query but remain connected when the query finishes. Do not include the GO terminator in the query.

-Q “query”
Execute the specified query, and then disconnect and close the sqlcmd utility. Do not include the GO terminator in the query.

-m error_level
Display message number, state, and error level only for messages of the specified level or higher. This information can also be specified in the SQLCMDERRORLEVEL environment variable.

-r [0 | 1]
Redirect error messages to the standard error device (the screen by default). The switch -r 0 will redirect messages with a severity level of 17 or higher only. The switch -r 1 will redirect all error message output (including print statement output).

-i input_file[,file2…]
Read input from the specified list of files rather than the keyboard.

-o output_file
Redirect output to the specified file rather than the screen.

-p[1]
Print performance information for each result set. If the 1 parameter is specified, the performance information is displayed as a series of colon-separated raw data values.

-b
If an error occurs, exit the sqlcmd utility and return a DOS ERRORLEVEL value.

-u
Store the output file in Unicode format.

-R
Use regional settings when converting currency data and data and time information into character format.

-v var=”value”[var="value"…]
Create scripting variables with the specified names and values.

-A
Use a DAC.

-X[1]
Disable commands that might compromise system security (ED and !! commands), display a warning, but then continue. If -X1 is used, display an error message and exit the sqlcmd utility if one of these commands is attempted.

-V severitylevel
Specify the lowest severity level that will be reported by the sqlcmd utility.


Working with the sqlcmd Utility

Any user who has a valid SQL Server 2005 account can invoke the sqlcmd utility interactively, submit commands, and display the results.

Executing commands using sqlcmd
Use the following procedure to execute a command interactively:

Open a command prompt window.

Type sqlcmd followed by any appropriate switches. To connect using Windows Authentication, simply type sqlcmd.

Type Transact-SQL statements and sqlcmd commands. You can type in multiple commands and spread them across multiple lines.

Type GO to execute the command batch.

Type QUIT to close the sqlcmd utility.

Executing Scripts Using the sqlcmd Utility

As well as running the sqlcmd utility interactively, you can store commands and Transact-SQL statements in a script file and invoke sqlcmd to execute this script. Many of the command-line switches for the sqlcmd utility are intended for use when running sqlcmd in this manner.

Executing a script
Use the following procedure to execute a script using sqlcmd:

Using a text editor, create a text file containing the commands and statements you want to execute.

Note
Make sure that you include the GO statement to actually run the commands.
Set the environment variables necessary for accessing the appropriate computer running SQL Server, most commonly SQLCMDUSER, SQLCMDPASSWORD, and SQLCMDSERVER.

Tip
Although you can specify login name, password, and server as command-line parameters to the sqlcmd utility, it is better practice to use the environment variables, since you can then avoid the need to hard-code these values into batch scripts.
From a command prompt, invoke sqlcmd using the -i switch to specify the name(s) of the script files. Capture the output using the -o switch.

Examine the ERRORLEVEL variable to ensure that the script executed successfully.

Examine the captured output file and check that the results are as expected.

Using Variables with the sqlcmd Utility

Using variables with sqlcmd allows you to create generalized scripts that can be executed against different databases and servers. Apart from the sqlcmd environment variables, you can define variables inside scripts using the :setvar command. You can also pass variables into sqlcmd scripts from the environment, or use the -v switch from the command line.

Using variables
Use the following procedure to execute a script using variables:

Create a sqlcmd script. Reference values that will be passed in using the following syntax:

$(variable)
For example:

SELECT $(colname)FROM $(tabname)GO
Execute the script using the –v switch to specify the values of variables. For example:

sqlcmd –i MyScript.sql –o MyScript.out –v colname=”name” tabname=”sys.databases”
Alternatively, you can define colname and tabname as environment variables.

Working with a Dedicated Administrator Connection

In earlier releases of SQL Server, connecting to a server that was unresponsive was not possible. However, a Dedicated Administrator Connection (DAC), a feature of SQL Server 2005, will allow access even when the server hangs or is otherwise unavailable.

A DAC has its own private SQL Server scheduler. Therefore, the only time you cannot connect is if the SQL Server service has been stopped or paused. Note that SQL Server only supports a single DAC; an attempt to use a second DAC while the first is still active will be refused.

Once you have gained access to the unresponsive server, you can execute commands to diagnose the problem, terminate misbehaving connections, or shut the server down cleanly and restart it.

Using a Dedicated Administrator Connection
Use the following procedure to open a DAC:

Invoke the sqlcmd utility specifying the -A switch:

SQLCMD –A
Diagnose and fix the problem, terminate misbehaving connections, or shut the server down cleanly.

1>SHUTDOWN WITH NOWAIT2>GOServer shut down by request
Tip
An unresponsive user connection is often caused by a process waiting for a lock that is held by a long-running transaction. You can use the sp_lock stored procedure to find connections that hold exclusive locks over resources and that are blocking requesting connections. You can terminate blocking connections using the KILL command if they do not complete in a timely manner.


*********************************************************************

Overview of SQL Management Objects

It is useful to be able to automate the administrative tasks that an administrator needs to perform, especially because it reduces the possibility of errors and inconsistencies. This is particularly true when an enterprise contains multiple SQL Server servers and instances. SQL Server 2005 provides the SQL Management Objects (SMO) API for this purpose.

Definition
SMO provides the ability to create administrative programs and scripts. It is a set of programming objects intended for writing programs used to manage SQL Server objects and tasks.

SMO is implemented as a .NET assembly (Microsoft.SqlServer.Smo.dll). SMO defines a hierarchy of objects and its own object model.

You can use SMO to build applications that perform many administrative tasks, such as retrieving and modifying configuration settings, creating new databases, managing SQL Server Agent jobs, and scheduling backups.

Comparing SMO and SQL Server Distributed Management Objects

SMO is intended to be a complete replacement for SQL Server Distributed Management Objects (SQL-DMO) supplied with earlier versions of SQL Server. The database engine in SQL Server 2005 has undergone many significant internal changes, and SMO is designed to take full advantage of these changes. SMO is optimized to make the most efficient use of resources, and balances the need to save memory against the requirements to query fully instantiated objects over the network. Using SMO, a developer can closely control the point at which objects are instantiated.

Note
Although SQL-DMO is shipped with SQL Server 2005, it is provided for backward compatibility only. SQL-DMO does not operate in an optimal manner with SQL Server 2005. You should use SMO for all new development.

SMO and WMI
SQL-DMO was intended to be a programmer-centric interface to SQL Server. SMO extends this programmability, and provides a more administrator-centric view through its simplified interface to Windows Management Instrumentation (WMI). You can make use of WMI with SMO for monitoring and configuring SQL Server 2005 servers and instances.

SMO Scripting
SMO provides enhanced scripting features through the Scripter class. For example, you can use this class to automatically script an entire dependency tree based on a single object.

Creating an SMO Application and Retrieving Server Information

You can use Visual Studio 2005 to develop SMO applications. These can be designed as Windows Forms applications, ASP.NET Web applications, or console applications, depending on your specific requirements. For example, if you need to manage databases from many locations within your company, an ASP.NET application running on the corporate intranet removes the need for installation on client computers.

Creating a .NET SMO application
Use the following procedure to create a .NET SMO application:

Open Visual Studio 2005.

Create a new project using the language of your choice and the required application type, for example, a Microsoft Visual Basic® .NET Windows Form project.

Reference the SQL SMO assemblies. To work with SQL Server, you must reference Microsoft.SqlServer.SMO. Depending on the functionality of your application, you may need to reference other assemblies in the Microsoft.SqlServer namespace—for example, Microsoft.SqlServer.ConnectionInfo.

Import the SMO namespaces by using the Imports statement in Visual Basic .NET or the using statement in Microsoft Visual C#®.

Connect to the computer running SQL Server by instantiating a Server object, obtaining the ConnectionContext object, specifying the server instance name, and connecting to the server. By default, Windows Authentication is used to connect when developing SMO applications.

Code your application.

Retrieving Information

After you have connected to a computer running SQL Server, you can use the Server object to retrieve server-specific information. The Server object has an Information property that exposes many of the non-configurable properties of the server.

The following table lists the properties of the Information object that you can use to return server information to your application.

Property Description
Edition
Gets the edition of the computer running SQL Server

IsClustered
Gets a Boolean value indicating whether the server is part of a cluster

IsSingleUser
Gets a Boolean value indicating whether the server is currently set as read-only

Language
Gets the default language of the computer running SQL Server

NetName
Gets the NetBIOS name of the server

OSVersion
Gets the operating system version of the computer

Parent
Gets the Server object that is the parent of this Information object

PhysicalMemory
Gets the total RAM (in MB) of the computer

Platform
Gets the hardware platform of the computer

Processors
Gets the number of processors installed on the computer

Product
Gets the product title for the computer running SQL Server

ProductLevel
Gets the product level for the computer running SQL Server

VersionString
Gets the version of the computer running SQL Server

Using SMO to Back Up a Database

You can also use SMO to perform regular administrative tasks, such as backing up a database.

You can use the properties of the Backup object to customize your backup to meet your requirements.

Backing up a database
Use the following procedure to write SMO code to back up a database:

Connect to the computer running SQL Server.

Declare and instantiate a Backup object.

Set the following properties of the Backup object:

Action

BackupSetName

Database

DeviceType

Any other custom properties, such as Incremental and NoRewind

Call the Devices.Add method of the Backup object, passing the path to the device.

Call the SqlBackup method of the Backup object, passing the Server object.

Properties of the Backup Object

You can use the properties of the Backup object to customize your backup to meet your requirements. The information in the following table describes the key properties of the Backup object.

Property Description
Action
The type of backup to be performed

BackupSetDescription
Textual description for a backup set

BackupSetName
Name used to identify a backup set

BlockSize
Block size unit to be used when formatting tapes as part of a backup

Checksum
Boolean property that determines whether a checksum value is calculated during backup or restore operations

Database
Database on which the backup or restore operation runs

DatabaseFileGroups
SQL Server file groups targeted by the backup operation

DatabaseFiles
Operating system files targeted by the backup operation

Devices
Backup devices specified for the backup operation

DeviceType
Device type of a device associated with the backup operation

ExpirationDate
Date and time when the backup set expires and the backup data is no longer considered relevant

FormatMedia
Boolean property that determines whether a tape is formatted as the first step of the backup operation

Incremental
Boolean property that determines whether to perform an incremental backup

Initialize
Boolean property that determines whether the devices associated with a backup operation are initialized as part of the backup operation

LogTruncation
Name of method used to truncate the database log as part of the backup operation

MediaDescription
Textual description of the media that contains a backup set

MediaName
Name used to identify particular media set

NoRewind
Boolean property that determines whether SQL Server will keep the tape open after the backup operation

Restart
Boolean property that determines whether the backup operation will restart if it is interrupted

RetainDays
Number of days that must elapse before a backup set can be overwritten

SkipTapeHeader
Backup operation logic that determines whether correct media is loaded

UnloadTapeAfter
Boolean property that determines whether tape media is rewound and unloaded after the backup operation completes

using System.SqlServer.Management.Common;
using System.SqlServer.Management.Smo;
Server myServer = new Server();ServerConnection conn = myServer.Connection.Context;conn.ServerInstance = txtServerName.Text;conn.Connect();1stDatabases.Items.Clear();for (int i = 0; i < myServer.Databases.Count; i++){ 1stDatabases.Items.Add(myServer.Databases[i].Name);}Database newDb = new Database(myServer, “NewDatabase”);newDb.Create();

Understanding SQL Profiler Enhancements in SQL Server 2005

SQL Profiler in SQL Server 2005 provides more information about performance and database processing than was available in earlier versions.

New and enhanced features
The important changes to SQL Profiler are summarized in the following table.

Click an item to view more information.
Feature Description
Profiling Analysis ServicesSQL Profiler can capture and trace events raised by SQL Server 2005 Analysis Services. (Profiling Analysis Services is beyond the scope of this course and will not be discussed further.)

Tracing Showplan and deadlock eventsSQL Profiler provides enhancements to Showplan and deadlock trace events, including:

Graphical representation of deadlock cycles, allowing you to analyze how deadlock occurs.

The ability to save Showplan results as XML, which can be imported into other tools capable of reading XML files.

Saving results as XMLSQL Profiler trace results can be saved as XML as well as the standard formats: ANSI, Unicode, and OEM.

Aggregating data

SQL Profiler data can be aggregated based on a selected key. You can use this new feature by providing a simple count of the number of times events have occurred.
SQL Profiler can capture and trace events raised by SQL Server 2005 Analysis Services. (Profiling Analysis Services is beyond the scope of this course and will not be discussed further.)

Saving a Trace as XML

XML is a portable data format, understood by an ever-increasing number of tools. Saving trace information as an XML file, rather than in the SQL Profiler native format, allows an administrator to use a variety of tools for analyzing the data. For example, you can import the XML data into applications such as Microsoft Office Excel®, or you can write a custom application to perform your analysis.

Saving a trace as XML
Use the following procedure to save a trace as XML:

In SQL Profiler, create and execute a trace.

When the trace has ended, on the File menu, point to Save As, and then click Trace XML File.

Specify a file name and location, and then click Save.

Overview of DDL Triggers

It is useful to be able to monitor data definition operations, such as a user creating or dropping a table, when auditing and regulating database actions. DDL triggers provide the means for capturing data definition events transparently, so that a user executing a data definition language statement will not be aware that the task is being observed. A DDL trigger fires whenever a user executes a specified data definition language statement, such as CREATE TABLE, DROP TRIGGER, or UPDATE STATISTICS.

DDL trigger scope
Unlike ordinary triggers that are associated with tables, a DDL trigger executes when a particular statement is executed, regardless of the target of that statement.

Some DDL triggers operate at the database level and only fire whenever the corresponding event occurs in a specific database. These triggers are predominantly concerned with objects in a single database, such as tables, indexes, users, procedures, views, and so on. An example of a DDL trigger that operates with database scope is CREATE_TABLE.

Other DDL triggers operate at the server level and fire regardless of the database in use. These triggers are associated with server-level objects, such as logins and security certificates. The CREATE_LOGIN DDL trigger is an example that operates with server scope.

For information on which DDL triggers operate at database and server scope, see the section “Event Groups for Use with DDL Triggers” in SQL Server 2005 Books Online.

DDL trigger process
DDL triggers fire on completion of the triggering action. For example, a DROP_TABLE trigger fires after the target table has been successfully dropped. There is no equivalent to INSTEAD OF triggers for DDL operations. A single DDL operation can fire multiple DDL triggers. The order in which the triggers fire is not documented; you should not rely on DDL triggers to execute in any particular sequence.

You can use the ROLLBACK TRANSACTION statement to abort the current transaction and undo any work that has been performed, including the DDL operation that caused the trigger to fire.

Creating DDL Triggers

You create DDL triggers using the CREATE TRIGGER statement. In addition, you can use some new syntax extensions that have been added to SQL Server 2005.

CREATE TRIGGER Syntax
CREATE TRIGGER trigger_nameON { ALL SERVER | DATABASE}[ WITH

[…,n] ]{ FOR | AFTER } { event_type | event_group ] [ ,…n]AS { sql_statement [ …n] | EXTERNAL NAME < method specifier > }[ ; ]
Event Data XML
In the trigger code, information about the DDL operation that fired the trigger is available in the form of an XML document, which can be obtained by using the eventdata() function. You can retrieve this XML data into an xml variable, and use the xml data type’s query method to extract specific information.Managing DDL Triggers

SQL Server 2005 has extended the syntax of the commands used for managing triggers with extensions specifically for DDL triggers. You can obtain a list of available triggers in a database, including DDL triggers, by querying the sys.triggers catalog view. You can retrieve the definition of a trigger by querying the sys.sql_modules catalog view. Triggers are deleted with the DROP TRIGGER command.

Information on the syntax for viewing, modifying, and deleting triggers is detailed in the following table.

Viewing triggers

SELECT nameFROM sys.triggersSELECT definitionFROM sys.sql_modulesWHERE [object_id] = (SELECT [object_id] FROM sys.triggers WHERE name=’trigger_name’)

Modifying triggers

DROP TRIGGER trigger_name [, …n]ON { DATABASE | ALL SEVER }[ ; ]
SELECT nameFROM sys.triggersSELECT definitionFROM sys.sql_modulesWHERE [object_id] = (SELECT [object_id] FROM sys.triggers WHERE name=’trigger_name’)

Important
When modifying or dropping a trigger, you must specify the ON DATABASE or ON ALL SERVER clause as appropriate for the trigger. If you omit this clause, SQL Server 2005 will assume you are referring to a standard trigger and report an error because it will fail to find it.

Using a DDL Trigger to Audit Database Operations

DDL triggers are important administrative tools. In this section you will see a fully worked example for a common administrative task; using a DDL trigger to audit database operations.

The three key stages in the process are shown in the following table.

Create an audit log table.

USE AdventureWorks
GO
CREATE TABLE dbo.AuditLog(Command NVARCHAR(1000),PostTime NVARCHAR(24),HostName NVARCHAR(100),LoginName NVARCHAR(100))
GO

Create the trigger.

CREATE TRIGGER AuditOperationsON DATABASEFOR DDL_DATABASE_LEVEL_EVENTSASDECLARE @data XMLDECLARE @cmd NVARCHAR(1000)DECLARE @posttime NVARCHAR(24)DECLARE @spid NVARCHAR(6)DECLARE @hostname NVARCHAR(100)DECLARE @loginname NVARCHAR(100)
– Retrieve the event data XMLSET @data = eventdata()– Extract data from the XMLSET @cmd = CONVERT(NVARCHAR(100), data.query(‘data(//TSQLCommand//CommandText)’))SET @posttime = CONVERT(NVARCHAR(24), @data.query(‘data(//PostTime)’))
SET @spid = CONVERT(NVARCHAR(6), @data.query(‘data(//SPID)’))-
- Retrieve other system informationSET @hostname = HOST_NAME()SET @loginname = SYSTEM_USER– Write event data to the log tableINSERT INTO dbo.AuditLog(Command,PostTime,HostName,LoginName)VALUES(@cmd, @posttime, @hostname, @loginname)GO

View the events captured in the audit log.

SELECT *FROM dbo.AuditLogGO
USE AdventureWorks
GO
CREATE TABLE dbo.AuditLog(Command NVARCHAR(1000),PostTime NVARCHAR(24),HostName NVARCHAR(100),LoginName NVARCHAR(100))GO

Overview of Event Notifications

Event notifications, like triggers, can respond to a variety of database events. Unlike triggers, which execute code in the same SQL Server 2005 database engine as the event that fired the trigger, event notifications can communicate with service brokers to transmit information about events to external processes—often other SQL Server 2005 instances.

Definition
An event notification reacts to one or more events in the database and sends a message to a Service Broker service designed to handle the events. A database event can be a DML or DDL operation on a database object, or a trace event similar to those that can be captured using SQL Profiler.

Capturing events
A Service Broker service is a stored procedure or application built using the Service Broker framework that monitors a queue for incoming messages. A Service Broker service can be written using Transact-SQL or one of the CLR languages. Messages are sent to the service by Service Broker, which uses a queue to persist message information until the service is ready to accept them. The service can also use a queue to hold requests until it can process them.

To simplify the event notification creation process, SQL Server 2005 includes a message type and contract designed for event notifications. The only Service Broker objects that you need to create are a queue, a service, and a route.

Creating Event Notifications

Use the CREATE EVENT NOTIFICATION statement to create a new event notification object. This table describes the four stages in creating and event notification and shows the syntax elements relevant to each of the steps.

Description
The first step is to specify the name of the event notification that you are creating. This name must conform to the rules for identifiers and must be unique with the scope they are created in.

CREATE EVENT NOTIFICATION event_notification_name

ON { SERVER | DATABASE | ASSEMBLY assembly_name | object_specifier object_name

FOR { event_type | event_group } [ ,…n]

TO SERVICE broker_service [ ,’broker_instance_specifier’]

The first step is to specify the name of the event notification that you are creating. This name must conform to the rules for identifiers and must be unique with the scope they are created in.
Syntax
CREATE EVENT NOTIFICATION event_notification_name

ON { SERVER | DATABASE | ASSEMBLY assembly_name | object_specifier object_name

FOR { event_type | event_group } [ ,…n]

TO SERVICE broker_service [ ,’broker_instance_specifier’]

You specify the scope of an event notification when you create it. For example, you may use a server-wide scope, and the event notification will occur whenever the UPDATE STATISTICS command is executed in any database on the server. You can restrict the notification so that it occurs only when a command is executed in the current database using ON DATABASE, or on a specified object.

CREATE EVENT NOTIFICATION event_notification_name

ON { SERVER | DATABASE | ASSEMBLY assembly_name | object_specifier object_name

FOR { event_type | event_group } [ ,…n]

TO SERVICE broker_service [ ,’broker_instance_specifier’]

The events trapped by an event notification can be very specific, as shown in the previous examples, or they can be more generic. For example, to trap all DDL events in the database, use FOR DDL_DATABASE_LEVEL_EVENTS. You can also trap all DML events over an object by specifying FOR DML_EVENTS. You can also capture a trace event.

CREATE EVENT NOTIFICATION event_notification_name

ON { SERVER | DATABASE | ASSEMBLY assembly_name | object_specifier object_name

FOR { event_type | event_group } [ ,…n]

TO SERVICE broker_service [ ,’broker_instance_specifier’]

This specifies the target service that receives the event instance data. The target service must use the same SQL Server Event Message type and contract that is used to send the message.

CREATE EVENT NOTIFICATION event_notification_name

ON { SERVER | DATABASE | ASSEMBLY assembly_name | object_specifier object_name

FOR { event_type | event_group } [ ,…n]

TO SERVICE broker_service [ ,’broker_instance_specifier’]

The first step is to specify the name of the event notification that you are creating. This name must conform to the rules for identifiers and must be unique with the scope they are created in.

Processing Event Notifications

The simplest way to create a Service Broker service for handling SQL Server events is to use a stored procedure that is activated whenever a message appears on a queue, sent by an event notification.

Receiving messages
The stored procedure should first retrieve the message from the queue using the RECEIVE command and store the information in variables. The WAITFOR command is used to suspend processing until a message is received or two seconds have passed. If no messages are received, no further action needs to be taken.

Processing messages
The stored procedure can then process the message.

Messages in the queue are assigned a message_type_name that describes the type of the message. You can use this to identify whether the message is an event notification or an event notification error message.

Messages also contain a message_body column that contains the actual event information. This column contains an EVENT_INSTANCE XML document that includes the same elements as the document generated by DDL trigger.

You can use the query method of the document to retrieve event information.

Managing Event Notifications

SQL Server 2005 provides new Transact-SQL statements for managing event notifications. These statements make it possible to view, modify, and remove event notifications.

Viewing event notifications and queues
You can obtain a list of event notifications by querying the sys.event_notifications catalog view. You can also view a list of queues, including those used by event notifications, by querying the sys.service_queues catalog view.

Removing an event notification
Use the DROP EVENT NOTIFICATION command to permanently remove an event notification from the database.

For more information on the DROP EVENT NOTIFICATION command, see the Transact-SQL Reference in SQL Server 2005 Books Online.

Note
Event notifications rely on SQL Server 2005 Service Broker functionality. To use event notifications, you must enable Service Broker by enabling the ENABLE_BROKER setting for the database in which your event notification code resides.

Defining Event Notifications

This code example enables Service Broker and creates a table called AuditLog that will be used to log captured events.

Creating a Queue

CREATE QUEUE NotifyQueue
GO

Creating a Service

CREATE SERVICE NotifyService
ON QUEUE NotifyQueue( [http://schemas.microsoft.com/SQL/Notifications/PostEventNotification])
GO

Creating a Route

CREATE ROUTE NotifyRoute
WITH SERVICE_NAME = ‘NotifyService’,ADDRESS = ‘LOCAL’
GO

Creating an event notification that fires when a CREATE TABLE operation is performed on the AdventureWorks database

CREATE EVENT NOTIFICATION Notify_Create_Table
ON DATABASE
FOR CREATE_TABLETO SERVICE [NotifyService]

Processing messages and showing the contents of the AuditLog table

DECLARE @messageTypeName NVARCHAR(256), @messageBody XML;
RECEIVE TOP(1) @messageTypeName = message_type_name, @messageBody = message_body FROM dbo.NotifyQueue;
IF @@ROWCOUNT = 0
RETURN
PRINT CONVERT(NVARCHAR(1000),@messagebody)
DECLARE @cmd NVARCHAR(1000)
DECLARE @posttime NVARCHAR(24)
DECLARE @spid NVARCHAR(6)
DECLARE @hostname NVARCHAR(100)DECLARE @loginname NVARCHAR(100)SET @cmd = CONVERT( NVARCHAR(100),@messagebody.query(‘data(//TSQLCommand//CommandText)’))
SET @posttime = CONVERT(NVARCHAR(24), @messagebody.query(‘data(//PostTime)’))
SET @spid = CONVERT(NVARCHAR(6),@messagebody.query(‘data(//SPID)’))
SET @hostname = HOST_NAME()
SET @loginname = SYSTEM_USERINSERT INTO AuditLog(Command,PostTime,HostName,LoginName)VALUES(@cmd, @posttime, @hostname, @loginname)
GO
SELECT * FROM AuditLog

Querying Dynamic Metadata

You can use dynamic management views and dynamic management functions to query dynamic metadata in SQL Server 2005. They provide information about the current state of SQL Server, such as locks currently held within a database.

Dynamic management functions are a special case of a dynamic management view in which the query requires parameters to be sent in order to execute. For example, sys.dm_db_index_physical_stats, which replaces the DBCC SHOWCONTIG statement, needs to know which table and index you require information about.

Dynamic management views
Dynamic management views are listed alongside the catalog views in the \Views\System Views folder in Object Explorer in SQL Server Management Studio. They are also defined in the sys namespace, but their names generally contain the dm prefix to distinguish them from catalog views—for example, sys.dm_tran_locks.

Querying dynamic management views
You can query dynamic management views using a standard SELECT statement. For example, the following code returns a list of queue monitors in SQL Server:

SELECT * FROM sys.dm_tran_locks

Dynamic management viewsys.dm_db_partition_stats
Returns page and row count information for each partition in the database

sys.dm_exec_sessions
Returns information about all the current sessions connected to the server

sys.dm_io_pending_io_requests
Returns information about pending input/output requests

sys.dm_os_memory_pools
Returns information about each simple object cache in the system

sys.dm_os_threads
Returns information about the threads in the system

sys.dm_broker_queue_monitors
Returns information about each Service Broker queue monitor in the system

sys.dm_tran_locks
Returns information about every currently granted or requested lock in the system

Querying Metadata

Catalog views of static metadata and dynamic management views of dynamic metadata provide tabular results showing queried information. On this page you have examples of the syntax used to view metadata for each and the resulting tables of information that you will receive.

Catalog Views
List the databases on the SQL Server server.

USE masterSELECT * FROM sys.databases

Querying Dynamic Management Views
List the tables in the database.

USE AdventureWorksSELECT * FROM sys.dm_db_partition_stats

The following code samples can be used to monitor a SQL Server server. Where a database name is required the AdventureWorks example database is used.

Catalog Views
List Databases

This code lists the databases on the server. Note that this view returns the same results regardless of current database context.

USE AdventureWorksSELECT * FROM sys.databases
List Tables

This code lists the tables in the current database.

USE AdventureWorksSELECT * FROM sys.tables
List Columns from all Database Tables

This code lists the columns from all the tables in the current database.

USE AdventureWorksSELECT * FROM sys.columns
List Columns in a Single Table

This code lists the columns in the Person.Contact table.

USE AdventureWorksSELECT * FROM sys.columnsWHERE [object_id] = (SELECT [object_id] FROM sys.tables ST JOIN sys.schemas SS ON ST.schema_id = SS.schema_id WHERE ST.name=’Contact’ AND SS.name = ‘Person’)
List Registered Assemblies

This code lists the registered assemblies in the database.

USE AdventureWorksSELECT * FROM sys.assemblies
List Registered Database Events

This code lists the registered events in the database.

USE AdventureWorksSELECT * FROM sys.events
List Server Configuration Options

This code lists the server configuration options. Note that this view returns the same results regardless of current database context.

USE AdventureWorksSELECT * FROM sys.configurations
Dynamic Management Views
List Table Partitions

This code lists the table partitions in the database.

USE AdventureWorksSELECT * FROM sys.dm_db_partition_stats
Transaction Locks

USE AdventureWorks
– list the transaction locks currently held in the database SELECT * FROM sys.dm_tran_locks
– execute a query without releasing locks and then list the locks.
– Note that there are many more locks than previously listed
BEGIN TRANSELECT * FROM Person.Contact WITH (HOLDLOCK)SELECT * FROM sys.dm_tran_locks
– commit the transaction, thus releasing the locks.
– Note that the list of locks has returned to the original value.
COMMIT TRANSELECT * FROM sys.dm_tran_locks

Introducing New Index Features in SQL Server 2005

SQL Server 2005 provides clustered and nonclustered indexes, just as SQL Server 2000 does. SQL Server 2005 also still supports indexes on computed columns and views. However, SQL Server 2005 extends the way in which indexes are structured and processed, as well as how new index types are added.

Click an item to view the description
Item Description
The ALTER INDEX statementOne new index feature in SQL Server 2005 is the ALTER INDEX Transact-SQL statement, which allows you to rebuild, reorganize, disable, or modify the options for an index. This command removes the need to drop and create an index to defragment it, and replaces some of the Database Consistency Checker (DBCC) commands used by earlier versions of SQL Server.

Online index operationsSQL Server 2005 provides the ability to manage indexes while they are in use, minimizing the maintenance window required. Previous versions of SQL Server acquired exclusive locks on the table and index, effectively blocking access to the table until the index operation had completed.

Online index operations require additional disk space to support online operations. You specify whether an index should permit online operations as part of the CREATE INDEX, ALTER INDEX, and DROP INDEX commands.

Parallel index operationsIndex operations, such as creating, altering, or dropping an index, can take advantage of multiple CPUs to perform sorting and scanning operations in parallel. This happens automatically in SQL Server 2005, and operations can use any number of processors up to the value specified by the max degree of parallelism server configuration option.

You can manage the number of processors used by specifying the MAXDOP query hint when executing CREATE INDEX, ALTER INDEX, and DROP INDEX Transact-SQL commands.

Locking optionsSQL Server 2005 introduces two new locking options when using indexes. These can be enabled simultaneously.

ALLOW_PAGE_LOCKS

When switched on, this option provides access to the index using table and page-level locks. When off, page-level locks are not used.

ALLOW_ROW_LOCKS

When switched on, this option provides access to the index using table and row-level locks. When off, row-level locks are not used.

Indexes with included columnsNonclustered indexes can now contain nonkey data in their leaf nodes. This feature can improve the performance of queries that access the included columns, at the cost of the additional storage required to hold those values. Indexes with included columns can be used to replace covering indexes used in earlier versions of SQL Server.

An additional benefit of indexes with included columns concerns the size limitations of index keys. In SQL Server 2000, the index key size was limited to 900 bytes. The leaf node data in an index with included columns can be up to 8060 bytes in size, which is the same as the maximum row size.

Partitioned indexesPartitioned indexes are another new index management feature of SQL Server 2005. A partitioned index is an index that is spread across the filegroups comprising the physical database. Partitioned indexes are commonly created over partitioned tables. Partitioning can improve performance by distributing data across multiple files, reducing contention, and increasing the possibility of performing IO operations in parallel.

For more information, see “Partitioned Index Concepts” in SQL Server 2005 Books Online.

XML indexesThe xml data type is a new feature in SQL Server 2005. You can create XML indexes over xml columns using the CREATE PRIMARY XML INDEX and CREATE XML INDEX Transact-SQL commands. XML indexes can greatly improve the performance of XQuery operations over XML data, although they can incur some significant cost when data is modified.

XML indexes have a number of features and limitations. For more information about XML indexes, see “Indexes on xml Type Columns” in SQL Server 2005 Books Online.

One new index feature in SQL Server 2005 is the ALTER INDEX Transact-SQL statement, which allows you to rebuild, reorganize, disable, or modify the options for an index. This command removes the need to drop and create an index to defragment it, and replaces some of the Database Consistency Checker (DBCC) commands used by earlier versions of SQL Server.

The following example shows how to use the sys.dm_db_index_physical_stats function over all tables in the current database:

SELECT TableName, IndexName, AvgFragmentation
FROM sys.dm_db_index_physical_stats (DEFAULT, ‘*’, DEFAULT, ‘DETAILED’)

The parameters of the sys.dm_db_index_physical_stats function, in order, are:

@TableName. The table about which to gather information. This can be the name of a specific table, or the values DEFAULT or NULL. DEFAULT and NULL both cause sys.dm_db_index_physical_stats to return information about all tables and views in the current database.

@IndexName. The index about which to gather information. This can be the name of a specific index, DEFAULT, NULL, or ‘*’. The values DEFAULT and NULL both return information about the base table only (or clustered index, if the table has one). The value ‘*’ returns information about all indexes on the table.

@PartitionId. The partition ID number of the index. The values DEFAULT, NULL, or 0 return information about all partitions.

@Mode. The scan level to use to obtain the requested information. Supported values are LIMITED, which reads only parent-level pages but is very fast, SAMPLED, which reads parent-level pages and sample leaf pages, and DETAILED, which reads parent-level pages and all leaf pages.

For more information about the sys.dm_db_index_physical_stats function, see the Transact-SQL Reference in SQL Server 2005 Books Online

Database Tuning Advisor

The Database Tuning Advisor, or DTA, in SQL Server 2005 is a new tool that extends the functionality of the Index Tuning Wizard in previous releases.
To tune a database, you need to specify the workload you want the DTA to analyze. The workload can be a table or file created from SQL profiler trace, or a file containing Transact-SQL scripts.
You also need to specify the databases, and optionally the database objects, that you want the DTA to include in the analysis.
The DTA uses the workload to analyze index utilization in the specified databases.
From its analysis of the workload, the DTA generates recommendations for indexes, and also generates reports that show index usage and performance metrics.


————————————————–
LAB

Step 1 : Create the DDL trigger.
Action:

Start SQL Server Management Studio and connect to the localhost server using Windows Authentication.
Create a new SQL Server Query and connect to the localhost server using Windows Authentication.
Using the query editor, add Transact-SQL code to create a new DDL trigger called CheckDropTable that responds to the DROP_TABLE event in the AdventureWorks database.
Add the following statements to the body of the trigger:
DECLARE @data XML
DECLARE @tablename sysname
DECLARE @schemaname sysname

SET @data = eventdata()
SET @tablename = CONVERT(sysname, @data.query(‘data(//ObjectName)’))
SET @schemaname = CONVERT(sysname, @data.query(‘data(//SchemaName)’))
These statements use the eventdata function to retrieve information concerning the table being dropped, and then parse the returned XML document to find the name of the table and the schema it belongs to.

Add the following statements to the body of the trigger:
IF @schemaname = ‘Production’
BEGIN
PRINT ‘Cannot drop ‘ + @tablename + ‘ as it belongs to the Production schema’
ROLLBACK TRANSACTION
END
This code examines the name of the schema the table belongs to. If it is named Production, a message is displayed and the DROP TABLE operation is rolled back.

Execute the code to create the trigger.

Result:
A new DDL trigger is added to the AdventureWorks database.

Step 2 : Test the DDL trigger.
Action:

Create a new SQL Server query that creates a copy of the Product table called ProductCopy in the Production schema using a SELECT INTO statement.
Attempt to drop the ProductCopy table you just created using a DROP TABLE statement. The message Cannot drop ProductCopy as it belongs to the Production schema is displayed and the transaction is aborted.
Create another copy of the Product table in the guest schema.
Drop the ProductCopy table you just created in the guest schema. The table will be dropped successfully, as it does not belong to the Production schema.
Try to query the ProductCopy table in the guest schema to verify that it was dropped. The message Invalid object name ‘guest.ProductCopy’. should appear.

Result:
The trigger prevents the ProductCopy table in the Production schema from being dropped, but allows the ProductCopy table in the Guest schema to be dropped.

Step 3 : Drop the DDL trigger and Production.ProductCopy table
Action:

Delete the CheckDropTable trigger from the Programmability\Database Triggers folder in Object Explorer.
Drop the ProductCopy table in the Production schema. The table should be dropped successfully.

Result:
Both the CheckDropTable trigger and the ProductCopy table are dropped.

Task 2
Creating Event Notifications

You can view the correct Transact-SQL code for this exercise in CreateEventNotification.sql in the D:\Labfiles\Solution folder.

Step 1 : Create the EventLog table and the EventLogProc stored procedure.
Action:

In SQL Server Management Studio, create a new table in the AdventureWorks database called dbo.EventLog. This table should have a single column called eventinfo using the XML data type.
Enable Service Broker, as shown here:
USE AdventureWorks
ALTER DATABASE AdventureWorks SET ENABLE_BROKER;
Execute this query.

Create the EventLogProc stored procedure, as shown here:
CREATE PROCEDURE dbo.EventLogProc
AS
DECLARE @message_body XML
;WAITFOR(
RECEIVE TOP(1)
@message_body=message_body
FROM EventLogQueue
), TIMEOUT 2000 ;
IF @@ROWCOUNT=0
RETURN
INSERT INTO dbo.EventLog(eventinfo)
VALUES (@message_body)
GO
This stored procedure copies the information from the message to a new row in the EventLog table. Execute this query.

Result:
A new table named EventLog is created, and the Service Broker is enabled for the AdventureWorks database. A new stored procedure named EventLogProc is also created.

Step 2 : Create the EventLogQueue queue, EventLogService service, EventLogRoute route, and EventLogNotify event notification.
Action:

Create the EventLogQueue queue that will be used by Service Broker to submit requests to the event notification service and execute the EventLogProc stored procedure:
CREATE QUEUE EventLogQueue
WITH STATUS = ON,
ACTIVATION (
PROCEDURE_NAME = dbo.EventLogProc,
MAX_QUEUE_READERS = 5,
EXECUTE AS SELF)
GO
Create the EventLogService that will be called by the event notification:
CREATE SERVICE EventLogService
ON QUEUE EventLogQueue
(
[http://schemas.microsoft.com/SQL/Notifications/PostEventNotification]
)
GO
Create the EventLogRoute that will be used to identify where messages should be directed:
CREATE ROUTE EventLogRoute
WITH SERVICE_NAME = ‘EventLogService’,
ADDRESS = ‘LOCAL’
GO
Create the EventLogNotification event notification. This event notification will fire whenever a CREATE TABLE or DROP TABLE statement is executed in the AdventureWorks database and invoke the EventLogService to record the event:
CREATE EVENT NOTIFICATION EventLogNotification
ON DATABASE
FOR CREATE_TABLE, DROP_TABLE
TO SERVICE ‘EventLogService’, ‘current database’
Execute the queries in steps 1-4 above.

Result:
The EventLogQueue queue, the EventLogService service, the EventLogRoute route, and the EventLogNotify event notification are created.

Step 3 : Test the EventLogNotify event notification.
Action:

Use the following commands to create and drop a new table:
CREATE TABLE Test
(col char)
GO
DROP TABLE Test
GO
These DDL statements will cause the event notification to fire and the two commands will be recorded in the EventLog table. Execute this query.

Use the following command to query the EventLog table:
SELECT * FROM EventLog
GO
Execute this query and verify that two rows are returned, each containing an XML document that describes the operations performed in the previous step.

Result:
A new table is created and then dropped, and these actions are logged in the EventLog table.

Step 4 : Remove the event notification objects.
Action:

Drop the EventLogNotification event notification.
Drop the EventLogService service.
Drop the EventLogRoute route.
Drop the EventLogQueue queue.
Drop the EventLogProc stored procedure.
Drop the dbo.EventLog table.
Close SQL Server Management Studio without saving changes.

Result:
The EventLogNotify event notification, the EventLogService service, the EventLogRoute route, the EventLogQueue queue, the EventLogProc procedure, and the EventLog table are all deleted.


Serving Your Internal Customers

June 17, 2007

Internal Customer QuestionnaireInstructions: Use this SkillGuide to create a questionnaire you can use to determine the needs of internal customers.Questionnaire Category Question
Processes and procedures How flexible are you when meeting internal customer requests?
What policies inhibit your ability to assist your internal customer?

Employee attitudes Do you consider your internal customer a partner?
How do you feel about providing customer service?

Communication Do you ask your internal customers what they want and expect?
Do you solicit feedback to improve internal customer service?

——————————————————–

Instructions: Use this SkillGuide to help you create an internal customer service strategy statement.

The Three C’s Purpose Possible Phrasing Stem
Customer Identify your internal customer “To provide support to those who depend on me…”

Contribution Identify the contribution you are expected to make “Our purpose is to…”
Claim to fame Identify the individual’s or department’s desired performance “We pledge our commitment to creating….”

————————————————————-

Instructions: Use this SkillGuide to help you identify and be flexible with the laws, policies, and standards that govern your organization.

Rule Definition Options
Law Set of federal, state, and local regulations set forth and enforced by the government

Inflexible
Policy Rules that dictate organizational action and behavior

Flexible only when the customer has suffered because of organizational error
Standard Common practices within a department or industry

Flexible in order to meet the organization’s external customer

——————————————————————————–
The Characteristics of a Service-oriented Mindset
——————————————————————————–

An internal customer is a person or group that is supported by or dependent on another within the organization. Just like an external customer, an internal customer has expectations that must be met by service-oriented individuals or groups within the organization.

To ensure effective internal customer service, people within an organization must develop a service-oriented mindset which is collaborative, responsive, and dependable.

collaborative
A collaborator works in concert with people. He takes on the behavior of a partner rather than a person centered on his own goals. One result of collaboration is that separate goals merge into one. Collaborators play a part in ensuring that the job gets done. However, you can’t effectively collaborate unless you embody the second characteristic of a service-oriented mindset and are responsive to your internal customers’ needs.

responsive
In a world where people need everything done yesterday, it isn’t hard to understand the value of a partner who can take the ball and run with it. An internal customer appreciates a partner who reacts quickly and decisively to get the job done. This characteristic is the visible manifestation of an employee who understands and respects the needs of his co-worker.

dependable
The third and perhaps most important characteristic of a service-oriented mindset is dependability. A service-minded employee is someone who can be counted on to produce on time—every time. Dependability doesn’t necessarily mean performing superhuman feats day in and day out. Rather, dependability is achieved when tasks, actions, and projects are stated in a manner that is fully understood. When the task is clearly defined, it becomes easier to set realistic deadlines and, more importantly, to meet them.
At its core, service is an attitude. To develop effective internal customer service, an organization must encourage and reward a service-oriented attitude that is collaborative, responsive, and dependable.

——————————————————————————–
Creating a Collaborative Team Environment
——————————————————————————–

Babe Ruth once remarked, “The way a team plays as a whole determines its success. You may have the greatest bunch of individual stars in the world, but if they don’t play together, the club won’t be worth a dime.” The same principle applies in the business world. As a manager, your success depends on your ability to create an environment that is open to collaboration, flexible with processes and procedures, and willing to use internal support networks.

Ultimately, the road to effective internal customer service involves three steps: determining the needs and expectations of internal customers; providing clear vision; and encouraging teamwork and collaboration.

Determine the needs and expectations of internal customers.

The first technique for supporting effective internal customer service is to determine the needs and wants of the internal customers. Your aim here is to identify the state of service in your organization. To accomplish this, you need to look for gaps in service in three key areas: processes and procedures, employee attitudes, and communication practices.
Processes and procedures – Effective internal service relies on processes and procedures that help your internal customers.
Employee attitudes – Effective internal service is fueled by an attitude of cooperation and partnership.

Communication practices – You can’t serve internal customers if you don’t ask them what they want. Another key to effective internal service, then, is to promote a culture that encourages open communication.

To gain an accurate assessment of the customer service gaps that exist in your organization, you must evaluate the true needs and wants of your internal customers. This step will ensure that your solution isn’t just another quick fix.

Provide a clear vision.

The second technique for supporting excellent internal customer service is to provide a clear vision of your company’s internal service strategy. An executive once asked his team members how they could expect their employees to provide outstanding service if they—the executive team—couldn’t define it. That’s exactly what creating an internal service strategy statement addresses. There is no magic formula, but here are a few tips for creating your vision statement:
It should complement the company’s existing vision and values.
It doesn’t have to be a particular length, but it should be clear and concise.

It should be actionable and describe what behaviors are expected.

It should not be developed in a vacuum–include employees, management, and customers in its development.

An internal service strategy vision statement should also include the three C’s: Customer, Contribution, and Claim to Fame.
The first C stands for customer. Your statement should clearly identify who the internal customer is. For example, an internal service statement might include: “Each associate we interact with…” or “To provide support to those who depend on me…”
The second C is for contribution. The internal service statement should identify what contribution the employee is expected to make. It can include phrases like “I will strive to,” “we promise to…,” “our purpose is…,” and so on.

The third C should address the company’s, department’s, or individual’s claim to fame for providing the desired contribution. For example, a facilities department would include “We insist on sparkling clean restrooms.”

Once you’ve created an internal customer service strategy statement, communicate it. Post it in the halls, include it in new-employee orientations, and demonstrate it every day.

Encourage teamwork and collaboration.

It’s not enough to communicate an internal customer focus, your employees must also be able to act on it. The third technique is to encourage teamwork and collaboration throughout your organization.
Develop cooperative goals throughout the company. – Cooperative goals create a sense of unity. For example, a cross-functional team may set a goal to process all customer work orders in 36 hours. The only way to reach this goal would be to have participation from the sales, order entry, manufacturing, shipping, and billing teams.
Provide the resources and the tools necessary to carry out the vision. – Having the resources will empower a person or department to continue to provide internal customer service. For example, data entry clerks need the skills to use a database to support their internal customers.

Support discussion and feedback about internal service systems. – A company must encourage feedback about systems and be willing to discuss ways of improving them. Employees know what’s working and what’s not. They need to feel that they can continually improve the processes.

Continually evaluate processes to improve results. – Your company as a whole should reflect on how it approaches internal customer service. By continually evaluating your processes and procedures, you can refine them and ultimately improve results.

Creating an atmosphere that is open to collaboration and teamwork can be difficult, but it is possible. First, focus on the gaps in your internal service and identify specifically what internal customers expect and want. Once you know people’s needs, create a clear vision of what your company’s internal customer service is, or should be. Finally, support a culture rich in internal customer service by supporting cooperative goals, providing resources, encouraging feedback, and continually refining processes.

——————————————————————————–
Overcoming the Four Obstacles to Teamwork
——————————————————————————–

Excellent customer service starts internally. Unless processes, procedures, organizational culture, and employee relationships support a team-based, service environment, the organization will fail to deliver excellent service. To achieve a high level of service, an organization must foster collaboration by overcoming the obstacles to teamwork.

There are four obstacles to developing true teamwork in an organization. Each obstacle and its remedy is described below.

Internal competition among employees
When a competitive environment is encouraged, employees aren’t motivated to work together. It’s “every man for himself” and anything that cuts into an employee’s productive time is resented as an impediment to personal success. The success of the organization just doesn’t count.
To overcome this obstacle by creating diverse teams, use a variety of team models. Show via role plays how every employee is a service provider. And set up a system of joint rewards or compensation for team success.

Pessimism about an overused phrase such as “teamwork”
The next obstacle to overcome is the pessimism that may have developed from all the talk about teamwork, followed by ineffective action or no action at all. Team members need to see support for teamwork from management. Executives set the tone by demonstrating their own teamwork. They also need to work with the teams, not with individuals.
To overcome pessimism, you need to address the issue head-on. Give employees a forum for voicing their fears and concerns about why teamwork won’t work. Then be ready to address each concern with positive action. Ensure that management demonstrates visible leadership support for the teams. Reward team and individual efforts, with the emphasis on team rewards. Reward systems need to recognize the results of teams. Individual rewards are acceptable as long as they’re accompanied by team rewards. Managers will see results where they put the rewards.

An organizational style that pushes instead of pulls for internal customers
Do you “pull” for your internal customers or do you just “push” tasks through their work stations? An organization that pulls for its customers focuses more on meeting specific needs than on blindly adhering to processes.
To overcome this obstacle, you must create a new organizational mindset by focusing on customer relationships as the key to customer loyalty. Read and discuss articles on the pull system. Encourage employees to assist and teach one another. Discuss the value of service in staff meetings. Discuss the pull system as a team, encourage assistance and teaching, and talk about the value of service. Keep coming back to this subject to convey the importance of these issues. By constantly bringing them up for discussion, you’ll keep these concepts in the front of your employees’ minds, where they can’t help but think of them as they interact with internal and external customers.

A lack of vision or support for the team from management
When management just says “fix this” and turns a committee loose on a project, the results are rarely satisfying. Without management sharing its vision or openly supporting a project, committee members will frequently just wander aimlessly.
To overcome this obstacle, you must negotiate contracts that reward the team and management for promoting team efforts. Demonstrate support of team leadership and establish open communication about all phases of department operations.

Excellent customer service starts internally and is reflected externally. To ensure effective internal customer service, your organization must work to overcome the four obstacles to teamwork. By meeting each obstacle head-on, you can turn a competitive group of loners into a service-oriented group of teams.

——————————————————————————–
A 3-step Method to Improve Internal Customer Service
——————————————————————————–

One of the best ways to improve your organization’s external customer service is to improve the level of service to your internal customers. An internal customer is a person or group that is supported by or dependent on another within the organization. Just like an external customer, an internal customer has expectations that must be met by service-oriented individuals or groups within the organization.

You can organize your company to establish excellent internal customer service by creating teams to analyze the current level of service, develop company-wide commitment, and manage conflict.

Step 1: Analyze the current level of service and identify areas for improvement.
The first step in the process is to organize a cross-functional task force to conduct research. This task force will identify who the internal customers are for each functional area. Then employees in each area can be surveyed. The survey should ask employees what their interdependent departments are doing right and where their needs are not being met.

In this way, and organization can build on its strengths and target its efforts on areas that need improvement. After the initial survey, an organization should survey again in six months to track its progress.

Step 2: Develop a company-wide commitment to customer service.
To succeed at improving internal customer service, an organization must develop company-wide commitment to it through education, communication, and amelioration.

Educate – An organization must educate its employees about the impact of customer service on the company’s ability to successfully conduct business. To educate employees, an organization might distribute a summary of research results or articles on the impact of customer service on customer loyalty.

Communicate – The importance of the initiative must be communicated to everyone. People also need to air their feelings and concerns. To communicate organizational commitment to customer service excellence, an organization can schedule dialogues and debates, and require all employees to attend at least one session.

Ameliorate – Ameliorate means to “make better.” Ameliorating customer service requires everyone to get involved, either by participating in cross-functional teams or through representatives from each area. These teams are charged with proposing solutions to the internal service problems.
Creating cross-functional teams composed of people from interrelated departments helps employees see that they have a say in making changes that will benefit them. Convincing them that management will really consider their proposals is the other half of the battle.
Step 3: Manage internal conflict.
Conflicts arise as team members look at issues from different perspectives. Conflict is a starting point for two-way communication and an important step in identifying workable solutions. When opposing parties express arguments of “opposition,” they raise the group’s level of awareness and understanding of the issues. As ideas are challenged, mutually agreed on elements can be identified.

Effectively managing conflict leads to better team solutions. Staff members will thoroughly understand the problems and the solutions, and they will have a vested interest in the results. If there is no conflict, you can create it by appointing a “designated critic” for each team meeting. The designated critic’s job is to challenge ideas and assumptions in an attempt to open the door for discussing and evaluating ideas.

One of the best ways to provide consistently excellent external customer service is to encourage consistently excellent internal customer service. As you work to improve the level of service internally, keep these three steps in mind. First, you must identify your current level of internal customer service. Next, you must develop a company-wide commitment to customer service through education, communication, and amelioration. And finally, you must manage conflicting perspectives to arrive at internal customer service solutions that benefit the entire organization.

——————————————————————————–
Values Necessary for Successful Partnering
——————————————————————————–

According to author, Roger B. Tompkins, partnering is “a relationship which occurs when two or more people voluntarily commit to help each other as part of achieving what each wants to achieve, independently.” Partnering is a teamwork mindset that can be externalized in many forms. In the customer service world, partnering can serve everyone well, especially internal customers.

For the partnering process to work, certain values must be held by both parties. These critical values are:

involvement
The first value that encourages partnering is involvement. Without buy in from suppliers, departments, managers, and customers, taking on a partnering mindset is difficult to do. Everyone needs to be encouraged to cooperate, mentor, support, educate, and train others. The spirit of competition must be minimized. Employees should be made to feel safe enough to reach out to one another.

acceptance
The next partnering value is acceptance. The negative effects associated with judging others’ skills have no place in partnering. Every employee should be treated as a valuable member of the team. Individual employees should be encouraged to value the skills and talents of their coworkers.

recognition
Helping others to achieve can only happen when you feel recognized for what you’ve done. In an environment that lacks proper recognition, employees view the recognition “pool” as limited, like a jar full of candy—once it’s gone, it’s gone. Recognition should be unlimited, immediate, and offered to all. Everyone appreciates thanks and praise.

honesty
Honesty is another value that contributes to partnering success. Information sharing must be inclusive rather than exclusive. Employees need to know that they’re getting honest, up-to-date information—whether it’s good news or bad.

energy
An atmosphere of positive energy can encourage partnering. Working with difficult customers for hours at a time is draining and can diminish commitment to service. To recoup, the work environment needs to be filled with positive energy rather than complaints. Managers should encourage teamwork and collaboration. Rewards should be given spontaneously as well as at regular intervals. Managers should have the freedom to offer perks and incentives for outstanding service.

renewal
An organization’s culture must also support periods of professional and personal renewal. To achieve renewal, an organization can offer regular workshops on interesting and relevant topics. Other opportunities for renewal include employee retreats, job responsibility swapping among employees, and, the use of compensation time. These offerings, coupled with the tone set by management, contribute to an environment where employees can thrive.
Partnering should be a good experience that brings forth growth, support, and better customer service. With willing partners, your organization can implement partner relationships successfully. The necessary partnering values play an important role in the outcome of the experience for the company and its employees. Involvement, acceptance, recognition, honesty, energy and renewal should be part of the organizational culture as well as the employees’ standard values.

——————————————————————————–
The Five-step Partnering Process
——————————————————————————–

Partnering is a powerful tool for improving internal customer service. It is a teamwork mindset created when two or more people within an organization voluntarily commit to help each other. Partnering takes commitment and a certain amount of effort. However, the process of setting up these relationships is simplified when you break the partnering process down into its five essential steps.

Step 1: Identify partnering opportunities.
To identify partnering opportunities, you must examine the organization for systemic strengths and weaknesses. Where and why do processes and procedures break down? Which parts of the organization run smoothly, and what makes them successful? If, for example, employees frequently complain about paycheck mistakes, the cause may be poor communication between department managers and accounting employees. Once the weakness is identified, a partnering relationship may be established to work the solution.

Step 2: Select a partner.
After identifying appropriate places to introduce partner relationships, the second step of the partnering process is to select a partner. Remember that partners can be individuals, departments, or even a category of people, such as your customer base. The partners should be willing, committed, accepting of others, honest, and excited about the opportunity for an alliance.
To help you select a potential partner, consider the following questions:

Does this partner have something new to offer me, my department, or my company?
Do I have skills I can share with this partner?

Does this partner have the time to commit to a working relationship?

Can this partner visualize the short-term and long-term possibilities of a partnering relationship?

Does this partner have strengths that overlap mine?

Can this partner envision, organize, and carry out a plan with me?

Selecting the right partner is critical for the success of the venture. If a potential partner doesn’t have the willingness, proper skills, or right attitude, the partnering relationship may fail.

Step 3: Establish mutual goals.
Once a partner has been selected, the next step is for both partners to establish mutual goals for the relationship. These goals must reflect why the decision was made to partner in the first place. Do the partners hope to improve communication, fix processes, set boundaries, or interact more effectively? These goals will chart the course for the relationship and keep both parties focused on desired outcomes.

Step 4: Create a communication plan.
You’ve now identified partnering opportunities, selected a partner, and established mutual goals. The fourth step is to create a communication plan for yourself and your partner. This plan is an important way to define expectations, boundaries, and goals for all communication.
To create an effective plan, consider the following questions.

Will you update each other via e-mail, voice mail, or in person?
How often will you communicate?

What obstacles will you face when communicating?

Will you formally document your communication?

How will you set time aside for communicating?

How will you be straightforward with each other?

The best method of communication for you and your partners will depend on your answers to these key questions.

Step 5: Measure progress.
The final step of the partnering process is to measure your progress. You need to assess how well you are meeting or exceeding your goals. The measurement can be both quantitative and qualitative. You could:
Keep informal or formal notes about progress
Evaluate process outputs based on performance statistics

Fill out surveys about improvements

Ask other employees to describe the partnering effects

Redefine goals for the partnering relationship.

If you want your partnering relationship to succeed, you need to identify partnering opportunities, select a suitable partner, establish mutual goals, communicate effectively, and measure progress. By following these five steps or guidelines, you will more quickly and easily arrive at an optimal partnering relationship.

——————————————————————————–
Partnering with Support Staff
——————————————————————————–

Partnering is the process of fostering a teamwork mindset. In the customer service industry, partnering is especially effective in showing support staff that they are valued, and encouraging better communication between sales and support teams. Partnering for this purpose is achieved by establishing the importance of the support person’s role, promoting teamwork, and encouraging open communication.

Establish the importance of the support person's role.
Support people who feel appreciated by their internal customers have higher morale and a better work attitude than those who don’t. Unfortunately, the business world is structured so that the support staff plays a secondary role to its internal customers. But their efforts contribute to the success of the department.

This is where partnering comes into play. The first partnering technique that you, as the internal customer, can use to make the support person feel appreciated is to establish the importance of that person’s role. When you make a sale or win a contract, make sure the support person receives recognition along with the salesperson. Encourage all salespeople to give timely and specific praise to support members for tasks well done.

Promote teamwork.
The second way you can partner with the support staff to show your appreciation is by promoting teamwork. As an internal customer, you can stress the key benefits of teamwork: more contracts, more money for the firm, more perks. You can include support staffers in all phases of planning and execution, and in contract celebrations. And, reward them for their work.

When you promote teamwork in this way, support people work with renewed energy and ambition. They understand the benefits of performing their tasks well, they see how their efforts influence the success of the internal customer and the company, and they can expect their efforts to be recognized.

Encourage open communication.
Another way to partner with support staff is to keep them informed. Support people who are kept “in the loop” are more appreciative and work harder than those who are not. Go out of your way to make support staffers feel like insiders when it comes to client moves. Encourage their input. Ask sales staff to request ideas and suggestions from their support people. Listen to their comments and act on all good suggestions.

One way to put these partnering techniques to use is to hold a staff meeting that includes both sales and support personnel. During the meeting, stress the critical role the support workers play in helping the sales team secure contracts. If you are applauding new contracts won by sales personnel, praise the services that the support personnel provided. Next, focus on promoting teamwork among the staff. Emphasize how teamwork might help the department break its sales record. Finally, encourage communication on the part of the support staffers. Inform them about potential clients the sales team has been asked to pursue, and set aside a half hour or so for the support people to address their concerns.

Partnering is an important tool internal customers can use to show support staff that they appreciate the role they play and the services they provide.

——————————————————————————–
What to Do When Rules Obstruct Service
——————————————————————————–

Laws, policies, and standards govern an organization’s internal processes, ensuring safety, efficiency, and consistent results. At times, however, these rules may prevent you from providing internal customers with the best service. When this happens, you need to understand your options.

When rules prevent you from effectively serving your customer, you need to know what, if any, alternative actions are appropriate. The following guidelines will help you to decide whether to search for a compromise.

Laws – Generally speaking, laws are not open for compromise. When you are faced with an issue where the solution would violate a law, your only course of action is to obey the law.

Policies – Policies are rules that govern an organization’s actions and behavior. They are created and enforced by the company. Though not immutable, they are largely inflexible. An employee may overlook a policy if the customer has suffered from a mistake made by the organization.

Standards – Standards are common practices within a department or an industry. They are open to some compromise. When a standard gets in the way, be sure to evaluate both the needs of the customer and the needs of the organization as a whole, then choose the option that best serves your customer.
When it comes to bending the rules to serve an internal or external customer, you need to be informed as well as flexible. Before you can determine what action to take, you must identify the laws, policies, and standards that govern your organization. Laws must be followed, but, you may have some flexibility when it comes to bending policies and standards. Find out what options are acceptable within your organization. Then strive to do what is best for the customer.

——————————————————————————–
Overcoming the Obstacles to Empowerment
——————————————————————————–

An empowered employee is a person who does what it takes to make the customer—and in the long run, the company—happy. An empowered employee feels free to do whatever it takes to ensure that the customer gets what he needs and keeps coming back for more. Yet obstacles often prevent employees from exercising this empowerment.

Some obstacles to customer service are instituted by managers in the form of policies, procedures, and standards. But the principle obstacles to empowerment are lack of purpose, lack of protection, and lack of praise. To overcome these obstacles, you must promote the vision of your organization, tolerate mistakes, and praise initiative.

lack of purpose
The first obstacle to empowerment is lack of purpose. Employees whose goals are to merely accomplish their tasks are typically less motivated than those with a higher purpose or goal.
A good way to overcome lack of purpose is to promote the organization’s vision. A vision is the higher goal of the organization—what it hopes to achieve beyond mere dollars and cents. An employee with a vision will almost always work with more zest than someone who views her job as taking 100 calls or processing 100 forms. Employees stay empowered when the vision is reiterated. Meetings are a good place to communicate vision. You can also promote vision during discussions with individual staffers and with an inspirational slogan that is strategically placed so everyone can see it.

lack of protection
Another obstacle to an employee’s empowerment may be a fear of punishment for doing the wrong thing. Employees may want to do everything in their power to please their customers, but they may fear retribution if they make mistakes when breaking a rule.
The best remedy for lack of protection is for management to demonstrate its tolerance of mistakes. Try to set a precedent for tolerating honest mistakes. Give employees the benefit of the doubt. When mistakes are made public, try to express a positive view of the situation. When someone makes a significant mistake, use it as a learning experience. Don’t let major or damaging mistakes go unchecked, however. The point is to create an atmosphere that gives your employees the freedom to sometimes go above and beyond when helping a customer.

Lack of praise
Lack of praise is an obstacle when employees see no good reason to knock themselves out to please the customer. A company whose managers never recognize their teams’ efforts will soon experience a decline in employee satisfaction and productivity.
To remedy this obstacle, managers must praise initiative through public recognition, private praise, evaluations, and promotions. Make it a policy to recognize initiative as a regular part of your activities. Post handwritten notes of thanks in the cubicles of exceptional employees, and you will inspire them to do an even better job. When employees consistently demonstrate initiative in behalf of your customers, mention it in evaluations and consider giving them a promotion.

An organization that empowers its employees not only enjoys a healthy work environment, but also positively affects its external customers. By removing the obstacles to empowerment, promoting vision, tolerating mistakes, and praising initiative, your organization can move a step closer to excellence in serving both your internal and external customers


Reporting Skills for Microsoft® SQL Server™ 2005 Reporting Services

June 17, 2007

An Overview of SSRSSSRS provides applications and tools to manage the entire lifecycle of enterprise reporting, which includes authoring, publishing, and managing reports. SSRS supports interactive reports, which are based on OLTP or OLAP data, in addition to reports that generate static content. These reports are server based and can be generated in several supported formats, such as XLS, PDF, HTML, and XML. SSRS displays the entire report server operations as Web services to provide interoperability with different solutions. Moreover, SSRS provides an extension model for data processing, rendering, security and delivery processing engines. By using this model, you can build custom extension tools.

SSRS contains a set of tools, such as Report Designer, Report Server, Report Manager, Report Model Designer, and Report Builder, for creating, publishing, and managing reports.

Component Description
Report Designer
A report-authoring tool that is hosted in the Microsoft Visual Studio® environment. This tool is used to design reports and publish them to a report server.

Report Server
A component that includes a Web service and the Microsoft Windows® Report Server service. The Web service provides a set of programmatic interfaces that client applications use to access report servers. The Report Server service provides scheduling and delivery services.

Report Manager
A Web-based report access and management tool that you can use to create, view, and manage reports.

Report Model Designer
A new tool in that is included in Business Intelligence Development Studio of SQL Server 2005. You can use this tool to view, design, edit, and refine report models.

Report Builder
A report-authoring tool that is used to design spontaneous reports by using data sources or report models and templates.

Authoring Reports

Report Designer is an authoring tool that you can use to create a report definition. A report definition is a blueprint of a report that is created before the report is processed and rendered. A report definition includes the layout, connection, and query information for generating the report. This definition is a Report Definition Language (RDL) file that defines the structure of the report by using an XML grammar. Because RDL is also an open schema, you can add attributes and elements to it.

Report Designer transforms your design choices into a report definition. However, you can also use any third-party authoring tool that generates report definitions. Report Designer creates a project workspace in Microsoft Visual Studio, and supports drag-and-drop operations to create reports. Typically, while using Report Designer, programming knowledge is required only if you want to add functionality to the reports.

To create reports by using Report Designer, you need to connect to the desired data source and build a query that retrieves data. Next, you need to lay out the report by dragging table, matrix, chart, and other report controls onto the design surface. Finally, you need to add data to the report and set properties to customize the layout of the report.

In SSRS, you can write custom code for report item values, styles, and formatting by using Microsoft® Visual Basic .NET. For example, you can write custom code to format currencies based on locale, flag certain values with special formatting, or apply other business rules that are in practice in your company. You can also reference an assembly that has been generated by using any language supported by the .NET Framework.

Publishing and Managing Reports

After you have designed and tested a report, you can use Report Designer to publish the report to a production report server. A report server is a stateless, server-managed component on the Web server that uses the SQL Server database engine to store metadata and object definitions. The report server exposes APIs that can be used for publishing reports.

After you publish a report, it becomes a managed component of the report server. You can manage the reports on the report server by using Report Manager or SQL Server Management Studio. The following are some of the report management tasks that you can perform by using Report Manager and the Simple Object Access Protocol (SOAP) APIs included with SSRS 2005:

You can set security permissions for individual reports to control user access to the reports. SSRS uses Windows authentication and role-based authorization to determine access to the report server. Role assignments also determine if a particular user or set of users have the privileges to perform specific report management tasks.

You can schedule reports to be generated at specific times or during off-peak hours. You can also schedule reports to be generated either once or on an hourly, daily, weekly, or monthly basis.

You can cache a copy of a processed report on the report server. Caching shortens the time required to retrieve a report if the report is large or is accessed frequently. When the server is restarted, all cached instances are reinstated when the Report Server Web service comes back online.

You can use subscriptions to schedule and automate the delivery of the most up-to-date report. A subscription is a standing request to deliver a report at a specific time or in response to an event, and in a defined format. Subscriptions provide an alternative to on-demand reporting, where you need to actively select the report each time you want to view it.

Accessing Reports

After a report is generated, it needs to be accessible to the end users who have the permissions to view the report. Users can access and view the reports by using a Web browser or Microsoft Excel 2003. SSRS 2005 supports two methods for accessing and delivering reports, on-demand access and subscription-based access.

On-demand access allows users to select reports from a report-viewing tool. To view a report on demand, a user needs to select a report from the report server folder hierarchy. Users can browse through the report server folders or search for specific reports by using Report Manager.

Subscription-based access automatically generates and delivers reports to a destination. To receive a report automatically, a user has to subscribe to that report. When the report runs, the user is either notified that the report is available or a copy of the report is sent through an e-mail message.

Report server administrators can build data-driven subscriptions that deliver reports to a large group of users. In a data-driven subscription, delivery settings are built from the stored data when the subscription is triggered.

Designing Ad Hoc Report Models

In SSRS, you can view, design, and edit report models by using Report Model Designer. Report Model Designer is a new SSRS tool, which is included in the Business Intelligence Development Studio. This tool uses a new XML-based definition language, called Semantic Model Definition Language (SMDL) for creating report models. SMDL is a set of information that describes what data is available, how the data is related, and where the data is located.

A report model provides an abstraction layer for the data store. Therefore, you can send queries to the abstraction layer rather than to the underlying data. The model permits aliasing the columns of the data store and the definition of relations across the referenced objects. This ensures that the end user is not required to know the underlying structures and can be provided with a business view of the system.

To build a report model, you need to first create a report model project in Report Model Designer. A report model project is the development environment for developing a report model and includes a data source (.ds) file, a data source view (.dsv) file, and one or more report model (.smdl) files. However, only one data source and data source view can be used to create a report model file. This file serves as a base for creating ad hoc reports in Report Builder.

Building Ad Hoc Reports

Report Builder is a report-authoring tool that you can use to design ad hoc reports by using data sources and report models. You can then publish the reports to a report server and manage them.

Report Builder provides the capability to work over the abstracted models provided by Report Model Designer. By using Report Builder, you can create table, matrix, and chart reports. When you launch Report Builder, you need to select the report model on which you want to base the report. Then, you need to select a report layout template and drag the entities and fields that you want to add to your report onto the design area. You can then customize the report by filtering, grouping, and sorting, or adding formulas to calculate values.

While designing a report, you need to work with the report layout. Report Builder uses Report Definition Language (RDL) to design report layouts. Therefore, the actual data is not visible when you are working on the report layout. However, you can run the report to see the data within the report layout. When you run the report, the report server combines the data with the report layout. After creating and saving your report, you can continue to open the report and edit the report layout. However, you can use Report Builder to open only reports that are created by using Report Builder.

————————————————————————————–

SSRS Core Concepts

——————————————————————————–

SSRS has a modular architecture. This feature supports processing of reports across multiple components that can be extended or integrated into custom applications. This feature allows developers to extend the reporting functionality to support custom features. SSRS also provides an API that is used as a Web service with SOAP and URL endpoints. This allows easy integration with new or existing applications and portals.

Data Sources, Datasets, Fields, and Filters

When you write a report, you need to identify the underlying report data. This includes setting up a connection to a data source, defining a query, and defining the list of fields that you want to include in the report. By using the following components of SSRS, you can specify the data that is to be included in a report.

Data Sources
An SRSS data source contains information about the connection to a database. This includes information, such as the server name, database name, and user credentials. The information contained in a data source depends on the type of database. SSRS supports relational databases such as SQL Server and multidimensional databases such as SSAS.

A data source can be contained in a single report, or can be shared by multiple reports. The definition for a report-specific data source is stored within the generated report. However, the shared data source is stored as a definition on the report server.

Datasets
An SSRS dataset contains information about the query and provides a reference to the data generated by the query, which is used by a report. A dataset includes a pointer to a data source, the query, and information about the data, such as collation and case-sensitivity. A dataset also includes a list of fields to be used by the report. A report can contain multiple datasets. These datasets can be used by different data regions on the report. The datasets can also be used to provide dynamic lists of parameters.

Fields
An SSRS dataset in a report contains a list of fields. A field can either be a database field or a calculated field. A database field contains a name property that can be used to provide a custom name for the database field. A calculated field includes a name and an expression. The expression can be simple, for example, concatenation of two database fields including first name and the last name, or it can be used to perform complex calculations.

Filters
An SSRS filter is used to filter report data after it has been retrieved from the data source. Filters are different from query parameters. When you use a query parameter, the data is filtered at the source. However, when you use a filter, the entire data set is retrieved, and then the filter is applied to the retrieved data.

A filter is useful for snapshot reports, in which the data is retrieved and stored with the snapshot report. By using filters, you can limit the data that a report displays, while using the static snapshot data. Filters are also useful when the data source does not support the use of query parameters to filter data.

Report Items

A report in SRSS uses report items to display data and graphical elements, such as data regions, text boxes, images, lines, rectangles, and subreports.

Table: A table or matrix cell includes a text box by default to display data. Text boxes can be placed anywhere on a report and can contain labels, fields, or calculated data. You can also use expressions to define data in text boxes.

Image: An image can be used to display a URL, an image stored on a Web server, embedded image data, or an image from binary data in a database. SRSS supports .bmp, .jpeg, .gif, and .png files.

Line: A line is a graphical element that you can place anywhere on a page. A line is defined by a start point and an end point and can have various attributes, such as weight and color assigned to it. A line has no data associated with it.

Rectangle: A rectangle can be used in two ways, as a graphical element and as a container for other report items. When you place report items within a rectangle, you can move them with the rectangle. This is useful for keeping numerous text boxes and other items together in a report.

Subreport: A subreport is an item in a report that points to another report on the report server. The report that the subreport refers to can either be a full report, which can also run on its own, or it can be a report that looks best when embedded in the main report.

All items in a report including groups, tables, matrix columns, rows, graphical elements and the report itself have properties associated with them. These properties govern the appearance and functioning of the item.

Moreover, each item has a set of properties that determine whether the item is visible or hidden. You can use these properties to hide items on a report. Preferably, you should hide data based on other data in the report, and provide an item that the user can click to toggle items between visible and hidden. For example, you can create a report that shows summary data when the report is first loaded and shows detail rows when users click a particular text box.

Data Regions

Data regions are report items that display the data that is stored in the underlying datasets. The following are the different types of data regions:

Table: A table data region presents data in a row and column format. The columns in the table are static and the rows expand downwards to accommodate the data. To organize the data in a table by selected fields or expressions, you can add groups.

Matrix: A matrix is also known as a crosstab. A matrix data region contains both columns and rows that expand to accommodate the data. A matrix can have dynamic or static columns and rows.

Chart: A chart data region presents data graphically in the form of bar, pie, and line charts.

List: A list data region displays data that is arranged in a freeform fashion. You can arrange report items to create a form with text boxes, images, and other data regions placed anywhere within a list.

You can nest data regions within other data regions. For example, if you want to create a sales record in a database for every sales person in the company, you can create a list with text boxes and an image to display information about the employee, and then add table and chart data regions that show the employee’s sales record.

The data within data regions, such as table, matrix, and list, can be sorted by fields and expressions. The sort capability is added to a report before it is published. You can sort data during data processing by specifying an ORDER BY clause in the query. You can also configure a report to support end-user sorting, allowing users to interactively change the sort order while viewing a report. To do this, you can use parameters to pass values to the underlying query.

Parameters

You can add parameters to a report to manipulate the data contained in the report. You can use parameters to pass values to an underlying query or filter. You can also use parameters to pass values to variables that are used for calculating data within a report.

You can design a report that allows the users to enter a parameter or select a parameter from the list of available values or valid values. These available values contain a set of value/label pairs. When the report is run, the users can select a label from the list and the corresponding value will be used as the parameter to generate the report.

You can also generate a report by defining a default value for the parameter. If all the parameters in a report have default values, the report will immediately display data when the report is run. If at least one parameter does not have a default value, then the report will only display data after the user enters all parameter values and runs the report. There are two types of default values, non-queried and queried.

A non-queried default value is a static value or an expression. A queried default value is an expression that points to a field in a dataset. If the query returns multiple rows, the value from the first row of the returned dataset is used.

Document Maps

A document map is a viewing mode that you can use to quickly navigate through the different sections of a report. When you view HTML, Excel, or PDF reports, a document map appears alongside the report. This document map acts as a table of contents for the report. When you click an item in the document map, the report refreshes to display the section of the report that corresponds to that item.

To create a document map, you need to add document map labels to the report items that should appear in the map, such as group headings and charts. These document map labels appear as items in the document map. When you view a report that contains document map labels by using the HTML Viewer, the document map is automatically generated. To view the document map, you can click the Show/Hide button on the report toolbar in the HTML Viewer.

—————————————————————————————-

Creating a Data Source

The first step in creating a report is to create a data source. A data source is a named collection of properties that describes a connection to an external database. It contains the following components:

Name of the data processing extension that is used to process the query.

Connection string that is used to locate the data source.

Credentials that are used to access the data source.

Reporting Services provides different types of data sources such as SQL Server, Oracle, ODBC, and OLE DB. By using SSRS, you can connect to relational databases such as SQL Server and multidimensional (OLAP) data sources such as SQL Server Analysis Services (SSAS).

You need to define the connection information of a data source while creating a report or data-driven subscription. However, after publishing the report, you can modify the data source properties or map the report to a different data source altogether. You can also embed a data source connection in a report or subscription, or define it as a shared data source item. A shared data source item can be created to define a connection to a frequently used data source and reference it whenever connection information of that data source is needed. A report server manages a shared data source item separately.

Steps to Create a Data Source
To create a data source, you need to perform the following steps:

Select the data source: During the creating of a report by using the Report Wizard, the first option is to select the data source. Here, the wizard also provides the option of defining a new data source and designating the same as a shared data source.

Specify connection information: In the Connections Properties dialog box, a data source type is selected. The provider selected to access a relational or multidimensional underlying data store also determines the other details that are required to connect to the data source.

While referencing data source connections, you can specify the server name by referring to the default or a named instance of the server. You can reference named instances by using the command \. In data source connections, you can also specify an initial catalog. If this information is not provided, the default database of the connected user is used.

Creating a Report Using the Report Wizard

This demonstration shows how to build a report in Business Intelligence Development Studio. The first step in creating a report is to create a report project. To do this, launch the Report Project Wizard. Next, create a data source that will be used to retrieve data. By using the wizard, you can select an existing data source or create a new data source.

In this demonstration, you will create a new data source, Adventureworks. On the Select the Data Source page, ensure that the data source type is selected as Microsoft SQL Server. Then, click Edit to set the connection properties of the data source. Specify the database server name. Notice that in the Log on to the server section, the Use Windows NT Integrated Security option is selected by default. Now select Adventureworks as the data source, and click Next.

To create a dataset from the selected data source, enter an appropriate query string or build a query by using Query Builder. In this demonstration, you will build a query by using Query Builder. To create a new query in the graphical query designer, click Generic Query Designer. Then, select the table based on which you want to define the query. In the Add Table dialog box, notice that all the database tables are listed. You can select one or more tables from this list.

In this demonstration, you will create a query based on the Product table. So, select Product (Production) table and click Add. Add the fields Name, Product Number, Color, ListPrice, Size, and Class to the query, and then click OK. On the Design the Query page, click Next. The Select the Report Type page appears. On this page, you can specify whether you want to create a tabular or matrix report. Based on your selection, relevant wizard pages will be displayed.

Demonstrated procedure
Creating a Report Using the Report Wizard

Start Business Intelligence Development Studio.

On the File menu, point to New, and then click Project. The New Project dialog box appears.

In the Visual Studio installed templates section, click Report Project Wizard. Click OK. The Report Wizard appears.

On the Welcome to the Report Wizard page, click Next. The Select the Data Source page appears.

On the Select the Data Source page, double-click the Name box, type Adventureworks, and then click Edit. The Connection Properties dialog box appears.

In the Server name box, type your computer name.

In the Select or enter a database name list, click AdventureWorks, click OK, and then click Next. The Design the Query page appears.

On the Design the Query page, click Query Builder. The Query Builder window appears.

On the Data view toolbar, use the toggle tool to switch from Generic Query Designer to Graphical Query Designer.

On the Data view toolbar, click Add Table. The Add Table dialog box appears.

Scroll down the Tables list, click Product (Production), and then click Add. The fields of the Product table appear in the Query Builder Tables pane. Click Close.

Select the Name, ProductNumber, Color, ListPrice, Size, and Class check boxes, and then click OK. The generated query appears in the Query string box.

On the Design the Query page, click Next. The Select the Report Type page appears.

Designing a Table Report

The Report Wizard provides options to build either a tabular or matrix report. The report is based on a selected data source. You can use Query Builder to design a query for fetching the data from the data source. Query Builder provides different interfaces for relational and multidimensional data.

In a tabular report, a table data region presents data in a row and column format. The columns in the table are static and the rows can expand downwards to accommodate the data. You can create a tabular report by clicking Tabular on the Select the Report Type page. When you do so, the Design the Table page is displayed. On this page, you can specify the arrangement of data in the table by using the following components:

Page: Fields added to this list are displayed at the page level. You can use this section to create a separate report for each set of data. For example, when you create accounts statement reports for your customers, you can use the Page section to display the customer address in the page header.

Group: Fields added to this list are used to group data. Each group of data is displayed in a separate section. For example, in an account statement, you can group data based on the Month field to automatically obtain monthly subtotals.

Details: Fields added to this list appear in the Details section of the report. These fields are grouped by the fields in the Group section.

To add a field, click the field in the Available fields list, and then click the Page, Group, or Details button. Alternatively, you can drag the field into the appropriate box. After selecting the fields, you need to specify the layout options for the report by using the Choose the Table Layout page. The Report Wizard provides two built-in layout options, Stepped and Block.

Click to view and print a table that explains the table layout options.
After selecting the layout, you need to select a style to be applied to the report by using the Choose the Table Style page. The five built-in styles available are Bold, Casual, Corporate, Compact, and Plain. The final step in creating a report is to specify the location for publishing the report and the name for the report. When you complete all the steps, Report Designer creates the report and displays it within the report project.

Modifying a Table Report
You can modify the table report by adding columns and rows. You can do this by right-clicking the row or column, and then selecting the appropriate action. These visual selections are similar to the set on column and set on row definitions in the MDX queries and provide a visual interface to replicate the hierarchy in the multidimensional data store. You can also add a new table to an existing report by using the Table control in the Toolbox.

A tabular report can use one of the following layout options.

Layout Option Description
Stepped
Creates a report that contains one column for each field and the group fields appear in the group headers to the left of the detail field columns.

Block
Creates a report that contains one column for each field and the group fields appear in the first detail row for each group.

You can select the Include subtotals check box to include subtotals for the numeric fields in the report. If the Stepped layout is selected, the subtotal is placed in the group header rows. If the Block layout is selected, the subtotals appear in the group footer rows.

When you select the stepped layout, you can select the Enable drilldown check box to hide the inner groups of the report. This provides a visibility toggle, which results in a drilldown report.

Designing a Matrix Report

In a matrix report, a matrix data region represents data in a multidimensional format. The rows and columns in the matrix can expand to accommodate the report data. A matrix can have dynamic or static rows and columns.

You can create a matrix report by selecting Matrix on the Select the Report Type page. When you do so, the Design the Matrix page is displayed. On this page, you can specify the arrangement of data in the matrix by using the following components:

Page: Fields added to this list are displayed at the page level. You can use this section to create a separate report for each set of data.

Columns: Fields added to this list map to the multidimensional selection on columns. Columns can be hierarchical and enable drilldown based on the column selection.

Rows: Fields added to this list map to the multidimensional selection on rows. Rows can be hierarchical and enable drilldown based on the row selection.

Details: Fields added to this list appear in the Details section of the report. The numerical data in this section is aggregated and displayed for each section based on the column and row selection.

Note
The numerical data in the details section is aggregated. By using data aggregation, you can display subtotals by row grouping. The default aggregation is the SUM function. Based on the row selection, the wizard also provides the option of drill down.

To add a field, click the field in the Available fields list, and then click the Page, Columns, Rows, or Details button. Alternatively, you can drag the field into the appropriate box.

After selecting the fields, you need to select a style to be applied to the report by using the Choose the Matrix Style page. The five built-in styles available are Bold, Casual, Corporate, Compact, and Plain.

The final step in creating a report is to specify the location for publishing the report and the name of the report. When you complete all the steps, Report Designer creates the report and displays it within the report project.

Modifying a Matrix Report
You can modify the matrix report by adding static rows and columns that are fixed at design time, or by adding dynamic rows and columns that are based on the underlying data. To add a dynamic row or column, drag the desired field from the Fields list onto a column or row header in the matrix. To add a static row or column, drag a field from the Fields list onto a populated data cell. You can also add a new matrix to an existing report by using the Matrix control in the Toolbox.

Creating a Dataset

You can create a dataset from any type of data store, such as relational or multidimensional, by using the Dataset tab in Report Designer. To create a dataset, click New Dataset on the Dataset tab. This opens the Dataset dialog box. In this dialog box, you need to specify the name and the data source for the dataset. You also need to select a command type. The following are the available command types:

Text: To use a query

StoredProcedure: To execute a stored procedure by name.

TableDirect: To retrieve data from a table by name.

You need to specify a query string, which can be a query, a stored procedure, or a table name. You can use the other tabs of Dataset dialog box to specify several properties of the dataset.

To create an MDX dataset for an Analysis Server database, you can use the Data view to specify a cube from which data needs to be retrieved. The metadata browser displays the objects stored in the current cube from where you can drag objects to the results and filter panes to form an MDX dataset.

You can also add calculated members and specify filters to an MDX dataset. Calculated members are custom members that are defined in a query. For example, if a cube contains the Sales and Cost members, you can define a calculated member named Profit that displays the difference between Sales and Cost. You can use the calculated members pane to add calculated members to your dataset.
Roll over the image for more information.A rollover graphic of the Dataset tab in Report Designer.

Creating a Chart Data Region

You can use the chart data region to graphically represent the data in a report. To add a chart data region to a report, in the Layout view, first click the Chart control in the Toolbox. Then, on the design surface, drag a box of the size you want the chart to be. Alternatively, you can click the design surface to create a chart of fixed size.

After adding the chart data region, in the Layout view, right-click the chart, and then click Properties. The Chart Properties dialog box is displayed. On the General tab, specify the chart name, chart type, and chart subtype. Then, click the Data tab and specify the following details:

Dataset name: To select a dataset for the chart.

Values: To provide the data for the chart. For example, in a column chart, data from the Values list determines the height of the columns and the labels on the y-axis of the chart.

Category groups: To group the data being displayed in the chart. Categories provide the labels for chart elements. For example, in a column chart, category labels are placed on the x-axis of the chart, one for each set of columns.

Series groups: To add an additional dimension of data to a chart. For example, in a column chart that displays sales by product, you can add a series group to display data by year for each group. Series group labels are included in the legend of the chart.

SSRS supports several types of charts, such as column, bar, line, pie, XY (scatter), bubble, area, doughnut, and stock.

Click to view and print a job aid to view more information about the chart types.
After defining the data to be used in the chart, you can define the appearance of the x-axis and y-axis in the chart by using the X Axis and Y Axis tabs of the Chart Properties dialog box, respectively. Then, you can specify the appearance of the legend in the chart by using the Legend tab and define the three-dimensional effects to be used by using the 3D Effect tab. Finally, you can set the filter options for the chart by the Filters tab.

The following are the chart types supported by SSRS.

Chart Type Description
Column
Displays data as sets of vertical columns. Values are represented by the height of the columns as measured on the y-axis. Category labels are displayed on the x-axis. Column charts are typically used to compare values between categories.

Bar
Displays data as sets of horizontal bars. Values are represented by the length of the bars as measured on the x-axis. Category labels are displayed on the y-axis. Bar charts are also typically used to compare values between categories.

Line
Displays data as a set of points connected by a line. Values are represented by the height of the point as measured on the y-axis. Category labels are displayed on the x-axis. Line charts are typically used to compare values over a period of time.

Pie
Displays data as percentages of the whole. Categories are represented by individual slices. The size of the slice is determined by the value. Pie charts are typically used to show percentages.

XY (Scatter)
Displays data as a set of points in space. Values are represented by the position of the point in the chart space. Categories are represented by different points in the chart. Scatter charts are typically used to compare distinct values across categories.

Bubble
Displays a set of symbols whose position and size are based on the data in the chart. Values are represented by the position of the point in the chart space and the size of the symbol. Categories are represented by different symbols in the chart.

Area
Displays data as a set of points connected by a line, with a filled-in area below the line. Values are represented by the height of the point as measured on the y-axis. Category labels are displayed on the x-axis. Area charts are typically used to compare values over a period of time.

Doughnut
Displays data as percentages of the whole. Categories are represented by individual slices. The size of the slice is determined by the value. Doughnut charts are typically used to show percentages.

Stock
Displays data as a set of lines with markers for high, low, close, and open values. Values are represented by the height of the marker as measured on the y-axis. Category labels are displayed on the x-axis.

Creating a List Data Region

A list is a data region that displays data in a freeform fashion. You can use a list data region to display a set of distinct non-repetitive values. You can also create a form that contains text boxes, images, and other data regions within a list.

You can create a list with any number of report items by using Report Designer. A list can be nested within another list to provide multiple groupings of data. For example, if you want to create a sales record for sales executives, you can create a list with text boxes and an image to display information about the employee, and then add table and chart data regions to show the employee’s sales record.

To add a list, you need to perform the following steps:

In the Layout view, in the Toolbox, click List.

On the design surface, drag a box to the size of the list you need. Alternatively, click the design surface to create a list with a fixed size.

Interactive Sorting

The data in the data regions of a table, matrix, or list reports can be grouped or sorted based on fields and expressions. You can form groups within a table to provide logical sections of data. In a matrix, groups are displayed as dynamic columns or rows. In a list, you can include any number of report items and form separate groups for each item. You can also create multiple groups by nesting a list into another report.

You can sort data in a data region by using sort orders specified in a query or parameter values of the report. In addition, SSRS provides a feature of sorting the data in a report after it is generated. This feature is applicable only for table and matrix reports.

SSRS also provides sorting on recursive hierarchy. A recursive hierarchy is a hierarchy of data in which all parent-child relationships are represented in the data. For example, an organization chart displaying the reporting structure in an organization can be created by using a recursive hierarchy.

To provide interactive sorting in a published report, you need to set textbox properties on column headings. You can specify sorting for multiple columns in the same report, and for nested or grouped data. To verify the sort action, you can preview the report or view the report by using Report Manager. In the output report, columns that support interactive sorting display arrow icons to indicate sort order. To change the sort order at run time, click the column headings.

To implement interactive sorting, perform the following steps:

In a published report, right-click a column heading based on which you want to sort the report.

Click Properties. The Textbox Properties dialog box is displayed.

Click the Interactive Sort tab.

Select the Add to add an interactive sort action to this text box check box.

To specify a sort expression, select the field that corresponds to the column for which you are defining the sort action.

Select the data region and scope for the sort. This determines whether the sort action applies to all of the data regions in a report, is limited to the data region that contains the textbox, or is scoped to some other set of data regions.

Click OK.

Nested Data Regions and Subreports

You can use a nested data region to display the same data region multiple times in a report. For example, you can create a sales order data report that repeats a single sales order table multiple times, once for each employee. You can use nested data regions to nest groups of data from the same data source within a single data region.

A subreport is an item that displays another report inside the body of a main report. If you have to create a report that uses grouping with different datasets, you need to use a subreport. You can use subreports to:

Nest groups of data from different data sources within a single data region.

Reuse a subreport in multiple parent reports.

Display a standalone report within another report.

When you run a report that contains a subreport, the report server has to process each report separately. If the report contains nested data regions, the report server processes only one report and thus saving the processing time.

The NoRows Property

Data regions are report items that generate and display rows of data based on underlying datasets. These rows are displayed as tables, matrices, lists, or charts. When the dataset of a data region does not return any data, a text box showing the value of the NoRows property is displayed.

By default, the NoRows property text box contains the same window properties, such as Color, Font, Padding, as that of the data region. However, you can edit these properties by using the Properties window of the Report Designer.

—————————————————————————————

Deploying a Report from Visual Studio

You need to set several deployment properties to deploy a report from Visual Studio.

In Solution Explorer, right-click the report project, and then click Properties.

In the Property Pages dialog box, set the several deployment properties, such as OverwriteDataSources, TargetDataSourceFolder, TargetReportFolder, and TargetServerURL.

After configuring the deployment properties, to deploy all the reports to the report server, click Deploy Solution on the Build menu. Alternatively, to deploy a report, right-click the report (.rdl file), and then click Deploy.

Deploying a Report Using Scripts

Scripting can be used to copy security definitions to multiple reports on a server, add and delete report server items, and copy report server items from one server to another. By using scripts, you can easily and efficiently perform repetitive tasks on a report server and duplicate work from one server to another. You can also interact with the report server by using Windows Management Instrumentation (WMI) in scripts.

You can use the SQL Server Management Studio to generate scripts against the objects hosted in the Object Explorer tree of an SSRS server. These scripts can be used to host multiple instances across servers. You can also play back these objects by using the rs command-line utility.

You can perform various operations on a report server by using the rs utility (Rs.exe). You can administer a report server by using Visual Basic .NET scripts and the rs utility. You can do this by executing the command rs -i inputfile -s serverURL [-u username] [-p password] [-l timeout] [-b] [-v var=value] [-t] at a command prompt.

The parameters of the rs utility are listed in the following table.

Option Parameter Description
-i
inputfile
Script file for execution.

-s
serverURL
URL (including server and vroot) to execute script.

-u
username
User name used to log in to the server.

-p
password
Password used to log in to the server.

-l
timeout
Number of seconds before the connection to the server times out. The default value is 60 seconds. If you specify this value to 0, infinite time out is set.

-b

Run as a batch and rollback if the command fails.

-v
var=value
Variables and values to pass to the script.

-t
trace
Include trace information in error message.

The rs utility takes a reporting services script (.rss) file as input.

An .rss file is a Visual Basic .NET code file, which defines the Reporting Services SOAP API. It is written against a proxy that is built on the Web Service Description Language (WSDL). You can create .rss files in VB.NET and use them to run any of the Reporting Services Web service operations.

Deploying a Report Using Report Manager

Report Manager is a Web-based tool that can be used to manage reports on a report server. By default, this tool is installed along with the report server. You can access Report Manager by using the shortcut available in the SSRS program group or the URL http:///Reports$instanceName. The Report Manager administrative website can be used to create and manage report folders, and organize reports under different folders.

To create a new folder in Report Manager, you need to perform the following steps:

Select the folder under which you want to create the new folder, and then click New Folder.

In the New Folder page, specify the folder name, and then click OK.

To upload a report to Report Manager, you need to upload the Report Definition Language (RDL) file for the report. The RDL file is an XML-based definition file that contains the complete definition of the report.

To upload a report to Report Manager, you need to perform the following steps:

Create an RDL file by using the report development tools such as Visual Studio Report Designer.

Create a folder in Report Manager, and then click Upload File.

Select the RDL file, provide a name to the report, and then save the definition.

In addition to the normal deployment options, you can integrate the deployment of reports into an application deployment project. A .NET application can deploy reports to the report server by posting the RDL files by using a Web services call containing the SOAP definition.

Managing Reports:Configuring Shared Data Sources

A data source defines the connection between a report and the underlying data source. You can create a data source that is specific to a report or shared by multiple reports. A shared data source provides connection information to multiple reports. You can create a shared data source by using SQL Server Management Studio or Report Manager.

To create a shared data source by using SQL Server Management Studio, you need to perform the following steps:

In Object Explorer, expand a report server node.

Right-click the folder in which you want to create the data source, and then click New Data Source.

On the General page of the New Data Source dialog box, specify the data source name, data source type, connection string, and security credentials. Click OK.

When you create a data source in a folder, it automatically becomes a shared data source.

To create a shared data source by using Report Manager, you need to perform the following steps:

Navigate to the Contents page and click New Data Source.

On the New Data Source page, specify the data source name, data source type, connection string, and security credentials. Click OK.

After creating a data source, you can open it in Report Manager by selecting it from the folder in which it was created.

Security Credentials of a Data Source
You can specify the following security credential options to a shared data source by using the Security tab of the Data Source Properties dialog box:

To prompt the user for a login name and password, click The credentials supplied by the user running the report.

To use the data source with reports that support subscriptions or other scheduled operations, click Credentials stored securely in the report server.

To pass the credentials of the user accessing the report to the server hosting the external data source, click Windows NT Integrated Security.

If you do not want to apply any security credentials, click Credentials are not required.

Managing Reports:Configuring Report Properties

After a report is published, you can set several report properties to meet customized requirements. For example, you can set properties to specify how users access the report, how the report server connects to an external data source, and how the report executes. To set report properties, you can use either Report Manager or SQL Server Management Studio.

To set report properties by using SQL Server Management Studio, you need to perform the following steps:

In Object Explorer, expand the report server node.

Expand the Home folder and navigate to the folder containing the report that you want to configure.

Right-click the report and then, click Properties.

In the Report Properties dialog box, click the page containing the properties you want to configure.

Configure the required properties, and then click OK.

You can also use SQL Server Management Studio to script report properties. This script is an rss script and is used by the Rs.exe utility for configuring report properties.

To set report properties by using Report Manager, you need to perform the following steps:

Navigate to the Contents page. Navigate to the report that you want to configure and open it.

Click the Properties tab and configure the desired report property.

When you have finished configuring the properties, click Apply.

You can then use Execution Properties to control whether the report executes on demand or on a schedule. You can set Execution Properties as one of the specifications described below.

Hide All

On Demand
This property specifies that the report should be cached when it is run, resulting in up-to-date data being displayed in the report. The cache is valid until it reaches the expiration time set. With this approach, if ten users open the report simultaneously, ten queries are sent to the data source for processing.

On Demand From Cache
This property specifies that the report should be cached temporarily when the report is run. With this approach, if ten users open the report, only the first request results in report processing. The report is cached, and the remaining nine users view the cached report.

From Snapshots
A report snapshot contains the layout information and a dataset that is retrieved at a specific point in time. A report snapshot is created and subsequently refreshed on a schedule, thus allowing you to specify when the report should be processed. For example, you can run a report as a report snapshot to prevent the report from being run during scheduled backups.

Managing Reports:Configuring Subscriptions

A subscription is a standing request to the report server to deliver a report at a specific time or in response to an event. Subscriptions use delivery extensions to distribute a report in a specific way and format. A subscribed report can be delivered by e-mail or file transfer or by custom delivery mechanisms. Administrators can use the null delivery provider method of subscription to improve server performance by preloading the cache.

Subscriptions can also be used to generate offline reports, generate archival reports, and batch reporting. For the subscription to deliver a report, you need to configure the credentials or specify no credentials.

In Report Manager, to create a subscription for a report, open the report you want to subscribe. On the Subscriptions tab of the report, click New Subscription to provide the subscription details.

The user creating a subscription owns it. Ownership of a subscription is not transferable. However, you can add additional users to a subscription depending on the configuration of file settings. Subscriptions may be standard or data-driven.

You can use Execution Properties to control whether the report executes on demand or on a schedule. You can set Execution Properties as one of the specifications described below.

Standard Subscriptions
Standard subscriptions are created and managed by individual users. This model is used to deliver data to a set of pre-defined users. A standard subscription consists of static values that cannot be varied during subscription processing. For each standard subscription, there is exactly one set of report presentation options, delivery options, and report parameters.

Data-Driven Subscriptions
Data-driven subscriptions can be used if you have a larger recipient list. In this model, you can customize a report to a set of users who are specified by a query. For this, you need to define a report with a query to vary report output for each recipient as required by them. This query is performed against a database or another data store that contains subscriber data. Data-driven subscriptions are dynamic as the values used for generating the reports are retrieved at run time from a data source.

Managing Reports:Scheduling Report Subscriptions and Processing

SSRS supports the following report-management tasks:

Delivery of reports in a standard or data-driven subscription.

Generation of report history so that new snapshots can be added to the report history at regular intervals.

Refreshing the data in a report execution snapshot.

Expiration of a cached report so that it can be subsequently refreshed.

To implement these tasks, you can use two types of schedules:

Report-specific schedules: Defined for an individual report. These schedules are created inline when you define a subscription or set report execution properties.

Shared schedules: Defined for multiple reports. These schedules are created separately, and then referenced in a subscription or property page when you need to specify schedule information.

You can create and manage shared schedules by using the Object Explorer in SQL Server Management Studio.

To create a shared schedule, you need to perform the following steps:

In Object Explorer, expand a report server node, right-click the Shared Schedules folder, and then click New Schedule.

On the General page of the New Shared Schedule dialog box, specify the name and the details of the shared schedule.

To modify an existing shared schedule, expand the Shared Schedules folder, right-click the schedule you want to modify, and then click Properties.

You can also use Report Manager to manage shared schedules. To do so, on the global toolbar, click Site Settings. In the Other section on the displayed page, click Manage shared schedules.

Report Manager also provides an option to pause and resume shared schedules that are in the scheduling queue. However, you cannot pause and resume a running report. When a shared schedule is paused, all report processing associated with the schedule is deferred until the schedule is resumed.

Managing Reports:Configuring Security Settings

SSRS provides security settings for the reports hosted in the report server. When users request for reports, the report server checks the user credentials and authenticates the user. However, when the report is generated offline and delivered by mail or as a file based on a subscription, the credentials are retrieved from the subscription configuration on the report server.

You can configure Internet Information Services (IIS) and Windows authentication for accessing reports from the report server. You can additionally secure IIS by using SSL or certificates. You can also configure Kerberos protocol authentication for multiple credential handshakes in the process of requesting reports and validating permissions.

In the report server, users are assigned to roles and the roles are assigned permissions on folders. All items inside a folder derive permissions from the folder. The subfolders or reports can choose to override the folder-level security settings. Even if users are authenticated by the Kerberos protocol, they have to be authorized by the report server to access a report.

In Report Manager, to add a user or group to one of the roles, click Site Settings on the global toolbar. In the Security section, click Configure site-wide security, and then click New Role Assignment to add a new user or group.

Click to view and print the table that explains the default roles and permissions in the report server.
When a new system role is assigned, the users or group accounts that you specify in the role assignment are domain accounts. The report server references users and groups from a Microsoft Windows domain, but does not create or manage them. The authentication process is handled outside the report server when a new system role is assigned. You can customize the permission sets for all new roles in Report Manager except predefined system roles.

There are two kinds of roles for report configuration, system-level roles and item-level roles. The system-level roles specify the system-level permissions of users such as modifying system role assignments and definitions, system properties, and shared schedules. The item-level roles specify the folder-level permissions of users such as viewing and managing folders, and creating reports. The default roles and permissions of a report server are displayed in the following table.

Roles Permissions

Browser
To view folders, reports, and resources.

To manage individual subscriptions.

Content Manager
To view folders, data sources, reports, and resources.

To manage all subscriptions, data sources, folders, individual subscriptions, report history, reports, and resources.

To set security for individual items.

To create linked reports.

My Reports
To view folders, data sources, reports, and resources.

Manage data sources, folders, individual subscriptions, report history, reports, and resources in My Reports Folder.

Create and publish reports linked reports.

Publisher
Manage data sources, folders, reports, and resources.

Create and publish reports and linked reports to the report server.

System Administrator
To view and modify system role assignments, system role definitions, system properties, and shared schedules.

System User
To view system properties, and shared schedules.

Managing Reports:Rendering and Viewing Reports

Report Definition Language (RDL) is an open schema that specifies how reports should be populated, executed, and rendered. You can create an RDL file by using Visual Studio Report Designer.

Report server uses rendering extensions for exporting reports to various formats. A rendering extension is a component or module of a report server that transforms the report data and layout into a device-specific format. SSRS includes six rendering extensions namely, HTML, XLS, CSV or text, XML, Image, and PDF. The HTML rendering extension renders a report in HTML 4.0 for versions 5.5 and 6 of Microsoft Internet Explorer. SSRS can also render reports in MIME Encapsulation of Aggregate HTML (MHTML). MHTML extends HTML to embed encoded objects, such as images, in the HTML document. In addition to these rendering extensions, you can create rendering extensions to export reports in other formats.

After rendering reports, you can use a report server to view them in three ways.

Click to view and print the table that explains the three ways to view a published report.
SSRS provides an inbuilt mechanism to maintain historical snapshot copies of reports on the report server. The report server execution log contains information about the reports that execute on the server. You can use this log to find out how often a report has been requested, which formats are used most frequently, and what percentage of processing time is spent on each processing phase. You can turn on or off the report execution-logging feature by using the options on the Site Settings page of Report Manager. By using this page, you can also specify the duration for which you want to keep the log entries.

Rendering and Viewing Reports

Print this page.The following table explains the three ways of viewing a published report.

Tool Description
Browser
A tool that helps you to view a report through a direct connection to the report server. To view a report, you can browse the folder hierarchy of the report server and select the report. However, the print functionality of a browser is not ideal for printing reports. To improve the print quality of the reports and to print multiple pages, you can use the client-side print functionality provided by SSRS.

Report Manager
A Web-based tool that includes features for viewing and managing reports. The easiest way to select and run a report by using Report Manager is to open the application and then search for the report. You can also navigate to the report that you want to view, select it to execute and render it.

Alternatively, you can execute the report by typing the URL http://< servername>/ReportServer?< reportfolder>/< reportname>.

Microsoft SharePoint® Web Parts
A tool that provides a Reporting Services Web part that can be configured to render a report on demand to any portal hosted by the SharePoint Portal Server. This report can be saved to any format, such as XLS and PDF, and stored on a file share. This file share serves as an offline repository for viewing older copies of the report.

—————————————————————————————

Using Report Model Designer:An Overview of Report Models

A report model is a business description of an underlying database. It describes data in terms of entities, attributes, and relationships or roles. These terms can then be used by end users to build ad hoc reports in Report Builder.

Report models provide familiar business names for database fields and tables, logically grouped model items, and predefined relationships between items within the data source. Therefore, the model allows the end user to comprehend the data without needing to understand the underlying data structure.

In technical terms, a report model is the metadata description of a data source, and describes the business relationships between the objects in a data source view. Therefore, a report model is one step removed from a data source view.

Before you build a report model, you must first create a report model project in the Business Intelligence Development Studio. A report model project is the development environment that is used to build a report model.

You can build your report model in two ways:

Launch Report Model Designer and start designing a model by using a data source.

Automatically generate a model by using a predefined set of rules.

If you are using Report Model Designer, you need to first create a data source and a data source view, and then generate the report model. Model Designer can only generate report model projects from SQL Server databases. Report models are published by Report Model Designer to the report server.

You can secure model items by setting properties and permissions to determine how model items behave in Report Builder. After the model is published, the end users must have the permissions to access the model in order to use it in Report Builder. In SQL Server Management Studio, you can do this by assigning role-based security permissions.

Using Report Model Designer:Creating a Report Model Project

You can create a report model by using Report Model Designer, which is part of the Business Intelligence Development Studio. Before you create a report model, you first need to create a report model project.

To create a report model project in Report Model Designer, you need to perform the following steps:

Click File, point to New, and then click Project.

In the Project Types list, click Business Intelligence Projects.

In the Templates list, click Report Model Project. Specify the name and location for the report model project.

A report model project consists of one or more data source (.ds) files, one or more data source view (.dsv) files, and one or more report model (.smdl) files. However, you can reference only one data source and data source view in an .smdl file. Therefore, before creating the report model, you need to create the data sources and the data source views.

You can create data source views by using the Data Source View Wizard. This wizard provides you the option of selecting related tables automatically. For example, if the data store had relationships across various tables, the data source view will inherit the same relationships when it is created. Also, you can relate tables in the data source view even if they were not related in the data store.

The data source view is the bridge between the database layer and the report model layer. After the data source view is created, you can modify the data source view by using the Data Source View Designer. You can view the table and column properties of the data source view by using the Table Organizer window.

Using Report Model Designer:Entities, Source Fields, and Expressions

Report Model Designer provides several logical collections of objects that map or extends the items in a database. These object collections include entities, attributes, and their relationships within a database. An entity is an object that maps to a table or view in the Data Source view. An entity contains attributes that describe the entity. Entities can map to multiple database items, but can bind to only a single database. For example, CustomerInformation can be an entity in a Sales database. The following table shows the types of attributes that describe an entity.

Click an item to view more information.
Attribute Type Description
Source FieldA source field is an attribute that maps to a column in a table. For example, FirstName and LastName are attributes that map to columns of a Customer table. After binding an entity, you can add a source field to a table.

Expression

An expression is an attribute that is derived from other attributes. An expression can contain functions, operators, and constants. For example, an expression FullName can be a concatenation of attributes FirstName and LastName. After binding an entity, you can add an expression to a table. You can also customize an expression by using Visual Basic .NET and write functions that use the full range of .NET Framework classes and referenced assemblies.
A source field is an attribute that maps to a column in a table. For example, FirstName and LastName are attributes that map to columns of a Customer table. After binding an entity, you can add a source field to a table.

Using Report Model Designer:Roles, Folders, and Perspectives

Entities are a collection of attributes, roles, and folders. An entity definition can be enhanced by using roles, folders, and perspectives.

Click an item to view more information.
Category Description
RoleA role defines the relationship between entities. The relationship type can be one-to-one or one-to-many. For example, in a company, an employee belongs to a department and a department can have multiple employees. To create a role, you can select the entities that form the relationship and then select the attributes that define the relationship. In addition, you need to map these attributes to the relationship type.

FolderA folder is a logical group of entities. A folder may contain additional definitions, such as perspectives or other folders. By using folders, you can provide a hierarchical definition for entities. You can view a folder hierarchy in Report Designer in the same way as in Windows Explorer.

Perspective

A perspective is a constrained view of a model. Unlike the complexity of a model, a perspective provides a simpler view of the model for increased usability. For example, a company can have a model that contains the information about the entire company but maintains separate perspectives for each of the departments in the company, such as sales, finance, and inventory.

Perspectives are also a useful way to secure the data. Because perspectives are subsets of the data, users can be given permissions to the perspectives and not to the underlying model. This ensures that the users view only a part of the data.
A role defines the relationship between entities. The relationship type can be one-to-one or one-to-many. For example, in a company, an employee belongs to a department and a department can have multiple employees. To create a role, you can select the entities that form the relationship and then select the attributes that define the relationship. In addition, you need to map these attributes to the relationship type.

Transcript
This demonstration shows how to create a report model by using Business Intelligence Development Studio. The first step in creating a report model is to create a report model project. In this demonstration, you will create a report model project, report model demo.

Next, create a new data source by using the Data Source Wizard. On the Welcome page of the Wizard, click Next. This demonstration uses an existing connection, AdventureWorksDW. On the Select how to define the connection page, verify whether AdventureWorksDW is selected in the Data connections list and click Next. On the Complete the Wizard page, verify whether the data source name is Adventure Works DW and click Finish. Notice that new data source is added to the Data Sources folder.

The next step is to create a data source view by using the Data Source View Wizard. The report model will be based on this data source view. In the Relational data sources list of the page, ensure that the AdventureworksDW data source is selected and click Next. Then, select all the tables from the Available Objects list and add them to the Included Objects list. Verify whether the name of view is AdventureworksDW and click Finish. Notice that new data source view is added to the Data Source Views folder.

Next, create a new report model by using the Report Model Wizard. In the Available Data Source Views list, verify whether Adventure works DW is selected and click Next. On the Select report model generation rules page, you need to select one or more rules that are used to generate the metadata of the model from the data source. Notice that some rules are selected by default. You can also select a language for the report model. In this demonstration, click Next to accept the default report model generation rules specified in the wizard.

On the Update Statistics page, verify whether the Update Statistics Before Generating option is selected. This option will update statistics if the data source view has been modified or the data in the data source has changed significantly. Click Next to accept the defaults. The report model is generated. Click Finish to complete the wizard. Notice that the new report model is added to the Reports Models folder.

Finally, verify whether the name of the report model is Adventure Works DW and click Run.

Demonstrated procedure
Creating a Report Model

Start Business Intelligence Development Studio.

On the File menu, point to New, and then click Project. The New Project dialog box appears.

In the Visual Studio installed templates section, click Report Model Project.

In the Name box, change the project name to report model demo, and then click OK.

In Solution Explorer of the report model project, right-click Data Sources, and then click Add New Data Source. The Data Source Wizard appears.

On the Welcome to the Data Source Wizard page, click Next. The Select how to define the connection page appears.

On the Select how to define the connection page, click Next to accept the defaults. The Complete the Wizard page appears.

On the Complete the Wizard page, click Finish to add the data source.

In Solution Explorer, right-click Data Source Views, and then click Add New Data Source View. The Data Source View Wizard appears.

On the Welcome to Data Source View Wizard page, click Next. The Select a Data Source page appears.

On the Select a Data Source page, click Next to accept the defaults. The Select Tables and Views page appears.

On the Select Tables and Views page, click the >> button, and then click Next. The Completing the Wizard page appears.

On the Completing the Wizard page, click Finish to add the new data source view.

In Solution Explorer, right-click Report Models, and then click Add New Report Model. The Report Model Wizard appears.

On the Welcome to the Report Model Wizard page, click Next. The Select Data Source View page appears.

On the Select Data Source View page, click Next to accept the defaults. The Select report model generation rules page appears.

On the Select report model generation rules page, click Next to accept the defaults. The Update Statistics page appears.

On the Update Statistics page, click Next to accept the defaults. The Completing the Wizard page appears.

On the Completing the Wizard page, click Run.

Click Finish

Using Report Model Designer:Publishing a Report Model

You can use Report Builder to create ad hoc reports only after the report model has been published to the report server. You can publish the report to a production report server by using Report Designer.

To publish a report model from Visual Studio, you need to perform the following steps:

Select the report model.

On the Build menu, click Deploy Solution. Alternatively, right-click the report model, and then click Deploy.

Before publishing the report model, you need to specify the report server and the folder in the Properties dialog box of the report project.

The model definition for the report model is stored in an XML file, which is based on the Semantic Model Definition Language (SMDL). SMDL is based on the Unified Modeling Language (UML). SMDL contains the definitions for the entities, folders, perspectives, and roles. When a model is published, the definition for the data source is mapped to the SDML and the entire model definition is published to the report server.

Using Report Builder:An Overview of Report Builder

Lesson Introduction

A report model provides a user-friendly way of viewing the contents and the connection information of a database. To build a report model, you need to create a report model project by using Report Model Designer. A report model project is a container for the model and consists of a data source, a data source view, and one or more report model files. After you create the report model project, Report Builder can use the model to develop ad hoc reports.

Report Builder is a report authoring tool that you can use to create and design ad hoc reports. The advantage of using Report Builder is that you can create ad hoc reports without being familiar with the underlying database structures. Moreover, you are not required to know any complex programming languages for creating reports.

Report Builder provides report templates that contain pre-defined data regions to build table, matrix, and chart reports. To create these reports, you need to select a report template and then drag the fields to the design area. The data to be included in the reports can be manipulated by filtering, grouping and sorting, or by using formulas. The reporting model contains the information that is required by Report Builder to automatically generate the source query and retrieve the requested data. You can format the reports by applying custom colors or fonts. You can also preview, print, and publish the reports.

Report Builder is a ClickOnce WinForms application that can be accessed by using Report Manager for centralized management. The Reports created in Report Builder are published by using RDL. Therefore, you can also open and modify these reports in Report Designer.


Difficult People in the Workplace

June 17, 2007

Properly Identifying Difficult People
Dealing with a Difficult Boss
How to Deal with a Difficult Employee
Determining If You’re a Difficult Person
Strategies for Coping with Difficult People
Identifying and Overcoming Defensive Behavior
Expecting the Best from Difficult People
The Communication Styles of Difficult People
Communicating Clearly with Difficult People
Using Nonverbal Clues with Difficult People
Listening Actively with Difficult People
Properly Identifying Difficult People——————————————————————————–Have you ever said something like, “Boy, life at work would be so much easier if I didn’t have to deal with Martha”? You obviously perceive Martha as a difficult person, but is she really?

Difficult people can be bosses or co-workers who intimidate or gossip about others. They might miss deadlines, blame their shortcomings on others, or complain about everything and everybody. Their behaviors result in lost time and talent as they often drive others away. Worst of all, they appear to have no idea that their behavior is perceived negatively.

The first step in dealing with this kind of person is to determine whether the individual is really a “difficult ” person or if the individual is just having an “off” day. To determine if someone is a difficult person, ask yourself or others the following three questions.

Does this individual have a history of being a difficult person?
Asking this question helps you determine if there was a time when the person didn’t act difficult. Check that out by getting a historical appraisal from others. Do they perceive the individual’s current behavior as a passing phase or something more prevalent?

Is the person reacting to a particular event?
This is a critical question to ask if the person doesn’t have a history of being difficult. Someone might be grieving over the death of a loved one or the breakup of a marriage. Or the individual might be disappointed about being passed over for promotion. Atypical behavior in these instances should be considered “normal” under the circumstances.

Am I overreacting to this person?
Sometimes your own perceptions or expectations can affect the way you view another person. Therefore, be sure to check your own reactions to the person. You can do this by talking to others and either verifying your perceptions, or gaining the perspective of a colleague or supervisor who may have a different reaction to the individual.
If the individual has demonstrated a history of being difficult, if there isn’t a precipitating event to explain the person’s behavior, and if your own perceptions are correct, then it’s probably safe to consider the individual to be a difficult person.
You always should ask yourself a few defining questions before assuming that someone is a difficult person. After all, you probably wouldn’t like it if someone mislabeled you as temperamental or hard to get along with. By taking the time to properly identify difficult people, you can then determine how to appropriately cope with them.

Dealing with a Difficult Boss

——————————————————————————–

You’ve probably met all types of people in your life—helpful people, mean people, boring people, and difficult people. You’ve probably figured out ways to avoid the latter, but what can you do if the difficult person is your boss? When dealing with a difficult boss, you can use a number of strategies, several of which are described below.

1. Rephrase instructions or requests.
Rephrasing instructions has several benefits. First, it’s simple. Don’t parrot your boss’s words, but do confirm every detail of your boss’s requests. Second, rephrasing gives you a sense of control. You are, in effect, emphasizing your competence. Third, and perhaps most important, it assures your boss that you’ve listened carefully to his or her directions and helps to allay any fears your boss may have that his or her instructions weren’t heard or won’t be carried out properly.

2. Commit to a course of action.
Committing to a course of action means that you take specific, not general, action. Bosses are held accountable for your work, and they can’t be vague about their promises. Consider the two statements below.

Wrong way: “I think I can summarize the results of our marketing meeting, but it will take some time. I’ll try to get it to you next week or the following week at the latest.”

Right way: “We’re meeting to discuss the results of the marketing meeting, and I’ll have our suggestions on your desk first thing Monday morning.”
3. Get on the boss’s good side.
The third method is to get on the boss’s good side. Every difficult boss needs someone he or she can trust. Why shouldn’t it be you? To get on the boss’s side, use the following strategies.
Follow through. If you say you’ll do something, then do it. By following through, you’ll prove to your boss that you’re dependable and trustworthy.

Don’t waste the boss’s time. Get to the point quickly when you bring your boss up-to-speed on developments. Keep it short and sweet, and tell the boss exactly what he or she wants or needs to know. You’ll be appreciated for your brevity.

Don’t be a gossip. If you prove you can keep a confidence, you’ll definitely get on your boss’s good side.

Never make excuses for poor work quality or missed deadlines—or anything else, for that matter. Bosses are bombarded by excuses every day. They don’t want to hear it; they want to see results.

Take responsibility for your mistakes. Don’t blame others for your shortcomings. Your boss has to take the heat for his decisions, and he’ll expect the same from you. Admit the mistake, explain what you’ll do to correct it, do so, and then move on.

Keep your sense of humor, no matter how hard that may be. Your boss needs a go-to person during high-pressure situations. If you can maintain your perspective and respond with grace, you’ll prove to be a valuable ally.
Difficult bosses can be tough, but if you work to make their lives easier, you might just find them returning the favor. Using survival methods such as rephrasing instructions, committing to a course of action, and getting on the boss’s good side might enable you to not only survive working with a difficult boss, but actually thrive on it.

How to Deal with a Difficult Employee

——————————————————————————–

If you’re a boss, chances are that you have, or have had, at least one difficult employee. What have you done to deal with that person? Did your actions help you deal productively with the individual? Or did your actions have the reverse effect and egg the person on?

There are both productive ways and destructive ways to supervise troublesome employees. Four strategies you can use to deal productively with a difficult employee are described below.

1. Never criticize the employee in public.
The reasons for the first strategy—never criticize an employee in public—are many, but the best reason for omitting this practice is that it isn’t effective. In fact, it usually backfires and produces the opposite effect. Public criticism shames and humiliates people. Even if the criticism is warranted, you may never again gain the trust and confidence of the injured party. Never assume that such criticism is harmless.

2. Praise the employee publicly.
Raising a person’s esteem in the presence of co-workers can pump up even mediocre employees, and motivate that person to keep up the good work. Public recognition also creates an upbeat spirit that energizes everyone present, not just the employee who’s receiving the praise.

3. Respond calmly and rationally.
Lashing out at errant or frustrating employees doesn’t work. Difficult employees often tune out the criticism and focus on the emotion. When the tongue-lashing is over, they’ll likely decide to cause you even more misery. Instead of striking out verbally, you should practice personal coping techniques such as deep breathing or slowly counting to 10 before responding. Tactics such as these can help you maintain your cool during critical moments.

4. Attribute positive characteristics to the employee.
The final strategy for dealing productively with a difficult employee is to attribute positive characteristics to the employee. When you do so, you’re actually giving the person advance credit for skills that you would like to see him or her develop. People build on their perceived strengths, and it doesn’t matter if those strengths are real or imagined. Offer your difficult employee a strength he or she can build on.

To deal effectively with difficult employees, there are a few points to remember. Praise, both public and private, always gets a better response than criticism. When you must give criticism, do it in private and offer constructive feedback, not personal attacks. Always respond to difficult employees calmly and rationally. Finally, remember that when you attribute a positive trait to an employee, that person is probably going to start acting that way regularly.

Determining If You’re a Difficult Person

——————————————————————————–

Do you find that you’re the only one who has problems with a particular person—someone who everyone else seems to get along with? Or have you noticed that you have very few, if any, friends at work? Has anyone at work told you you’re annoying? Are you reading this SkillBrief because your boss told you to?

If you answered “yes” to any of these questions, you’ll have to consider that maybe you are the difficult person. It’s easy to blame conflicts on the other guy, but saying it’s the other person’s fault doesn’t necessarily make it so. Before you point your finger, you should take a look at yourself. Use the following strategies to determine if you’re the difficult person.

1. Evaluate your own actions and behaviors.
Self-examination is always difficult, but it can be extremely worthwhile. Some of the areas in which you should evaluate yourself, and some points to keep in mind, are listed below.

Ask yourself if you’re judgmental. Judging others is an easy way for you to feel superior. It also allows you to avoid examining yourself.

Has anyone ever told you that you never listen? When someone is speaking, do you interrupt, or do you change the subject and head off in another direction? If you answered “yes” to any of these questions, quit talking and start listening.

How tolerant are you? If your viewpoint must be the only right one, you’re far too intolerant. People who are open to new ideas and different ways of doing things are generally happier and better liked than their counterparts.

A mature person thinks before he acts. Keep that e-mail one day before sending it, bite your tongue before lashing out, take deep breaths, count to 10, and consider your next move. You’ll reduce your stress level and the number of regrets you’ll have later.
These aren’t the only areas in which you should evaluate yourself. However, they can provide a good starting point. Depending on your responses, you’ll find yourself asking additional questions that will help you clarify areas in which you’re difficult.
2. Ask a close friend to assess your character and behavior.
The next thing you can do is talk to a close friend and ask for an honest assessment of your character and behavior. Assure your friend that you won’t get angry with him or her, and be sure that you don’t. The questions listed above are appropriate ones to ask your friend to respond to. And like before, you’ll find yourself asking more in-depth questions as your friend offers you feedback. The information you glean can be extremely valuable. View it as such, and learn from it.

3. Put yourself in someone else’s shoes.
Another thing you can do is to put yourself in someone else’s shoes to try to determine the other person’s perspective of you. As you assess yourself through someone else’s eyes, write down the mannerisms you have that might annoy that person. When you put yourself in someone else’s shoes, the information you learn from the experience won’t necessarily be accurate, but it will give you some perspective. And at this point, that may be all you need to confirm that you are a difficult person.

If you seriously spend some time in self-evaluation, get some input from a friend, and take the time to put yourself in someone else’s shoes, you create the possibility for change. If you’ve been tough to work with in the past, you’ve now got a chance to make a change. One thing is certain: Everyone will appreciate your efforts.

Strategies for Coping with Difficult People

——————————————————————————–

How often, after losing an exchange with a difficult person, have you slapped yourself on the forehead and thought, “Why didn’t I handle that better?” Brain freeze, a slang expression for the inability to cope spontaneously, is a common problem when dealing with difficult people who seem to have a knack for triggering automatic defensive behaviors. The best way to handle brain freeze is to plan ahead for coping with these difficult people.

Your plan should take into consideration the type of person you’ll be dealing with, the typical behaviors the person will exhibit, and the actual coping steps to be used. Also, you should get input from others who aren’t part of the problem, because they might have insights you haven’t thought of. Then you should formulate your plan, review your plan with an objective person, and practice, practice, practice.

1. Formulate your plan.
The first strategy, formulate your plan, comprises four steps, which are described below.

The first step is to write down the actions and behaviors the difficult person displays. Does the person get angry easily? Does he shout? Is he aggressive? Is he on a power trip?

The second step is to write down how you’ve responded to the difficult person’s behaviors in the past. Did you lose your cool? Did you shout? Did you quietly withdraw? Did you become sarcastic?

The third step of formulating a plan is to evaluate your notes. Which of your responses, if any, seemed to improve your interaction with the difficult person? Which responses seemed to aggravate the situation?

The fourth step of formulating your strategy is to determine a course of action. Jot down everything that pops into your head. Your initial ideas don’t have to be realistic, or even serious. Just get them all on paper. When you’re done writing, examine the ideas until you find one you think is viable.
Write down your new plan and the date by which you’ll carry it out. Committing to a definite date takes your plan out of the realm of good intentions and makes it a practical reality.
2. Review your plan with an objective person.
Choose someone trustworthy with whom you can review your plan. Ask this individual if your perceptions are accurate and if your plan is truly realistic. If necessary, work with this individual to refine your plan or your projected deadline for following through with it.

3. Practice its execution.
The third and final strategy is to practice your plan of action with someone. Thinking about your responses isn’t enough. Practice out loud so you can hear the words. Practice will make your responses flow smoothly and naturally.

Once you incorporate all three strategies—formulating a plan, reviewing it with an objective person, and practicing its execution—you have a viable plan for coping with the difficult person. Learning to plan ahead can make your coping strategies more effective.

Identifying and Overcoming Defensive Behavior

——————————————————————————–

Everyone gets defensive at some time or another. It’s a natural reaction to any number of circumstances. But by becoming defensive, you delay or deflect any chance of resolving the issue that made you defensive in the first place. Therefore, it’s important to understand the types of defensive behavior and be aware of how you can overcome your defensive reactions when you’re placed in difficult situations at work.

At the most basic level, defensive reactions are aimed at survival. The defensive reaction to a physical threat is to fight or to run. But most perceived threats in the workplace are to an employee’s emotional or psychological well-being—or, more specifically, to the employee’s self-esteem. The response, however, is similar to a perceived physical threat—people either strike out verbally or they retreat.

These instinctive responses result in the four common types of defensive reactions you use in difficult situations—blaming others, blaming yourself, walling off, and diverting attention. Details about these four defensive reactions are provided below.

Blaming others or blaming yourself
When you feel threatened, it’s common to retaliate by blaming someone else. However, if the other person refuses to let you blame him or her, you could easily feel threatened enough to start blaming yourself instead of the other person. By placing the blame on yourself, you’re still reacting defensively. Your response is calculated to deflect further blows from the other person and elicit sympathy as well.

Walling off
Some people “wall off” their perceived attacker when they’re threatened. That is, they erect an imaginary wall between the threat and themselves. From that point forward, they refuse to communicate.

Diverting attention
The “diverter” is someone who uses misdirection to deflect threats. He might try to change the subject or use humor or flattery to placate his attacker and divert attention from himself.
Now that you are familiar with the most common defensive behaviors, you’re ready to learn how to overcome them. The three steps for responding nondefensively in a business situation are listed below.
Note which of the four defensive behaviors you’re about to use.
When someone says something that makes you want to react defensively, instead of instantly reacting, pause. Stop what you’re doing and evaluate your initial, internal response to the given stimuli. While you’re pausing, note which defensive behavior you were about to use. Were you just about to blame someone else? Were you going to try to deflect attention away from yourself? Were you prepared to blame yourself for the problem? Or were you just going to shut down all communication and leave?

Identify the threat.
What do you think you’re being accused of, and why? For example, if your team is late in turning in a project, do you feel like it’s your fault? Or do you know that it’s someone else’s fault, but you’re worried that you’ll be blamed instead? Are you afraid of appearing weak, incompetent, or foolish in the eyes of your co-workers and bosses? Dig deeply to unearth just what it is, exactly, that you’re afraid of in a certain situation.

Plan a nondefensive response.
If you know what threatens you, it’ll be much easier for you to react without defensiveness when you’re placed in a threatening situation. For instance, if you know your team will be criticized because a project deadline was missed, plan to accept responsibility. Then be prepared to outline the steps you’ll take to ensure that future project deadlines won’t be missed.
It’s easy to react defensively in difficult situations. However, by being aware of the different types of defensive behavior, and following the three steps above, you’ll be able to respond calmly and rationally to any situation, no matter how threatening it is.

Expecting the Best from Difficult People
——————————————————————————–

Why do average workers become exceptional when they work with one boss, but remain average when they work with a different boss? If you were to ask an exceptional worker this question, he’d probably reply that his boss expects the best from him. And if you were to ask an average worker this question, he’d probably tell you that his boss doesn’t expect him to do anything more than what he’s paid to do.

The concept is the same when you’re dealing with difficult people in the workplace. Expect the worst from them, and they won’t disappoint. Expect the best, and you’ll get more. To expect the best, you must erase those old, negative expectations you have about the difficult people in your life. The following methods will help you get the best from a difficult person at work.

1. Give the person the benefit of the doubt.
One method for expecting the best from a difficult person at work is to give him the benefit of the doubt. Assume he doesn’t know he’s being difficult.

2. Attribute the desired behavior.
Another method for getting the best from a difficult person at work is to attribute the desired behavior to the difficult person, even if the person isn’t displaying that behavior at the time. For example, attribute behaviors such as being evenhanded, fair-minded, and understanding to the person. This may encourage the person to then exhibit those behaviors, because if the person doesn’t, he or she would risk not living up to your advance praise.

3. Reinforce positive behavior.
The third method is to reinforce the positive behavior you attributed to the difficult person. For example, when the individual acts in an evenhanded and fair-minded manner in the future, you should reinforce that behavior.

Difficult people sometimes need to see their positive characteristics through the eyes of others before they can find the courage to change. You’re giving the person the benefit of the doubt when you say you aren’t sure that he knows he’s a difficult person. When you thank him for being patient, you’re attributing to him the behavior you’d like to see him demonstrate. When he does demonstrate that behavior, you should reinforce it by drawing attention to it. Remember to expect the best from difficult people, and in response, they just might try to deliver their best.

The Communication Styles of Difficult People

——————————————————————————–

To communicate effectively with a difficult person in your workplace, you first have to know something about that person’s communication style. There are four basic communication styles you’ll encounter in your workplace—concise, analytical, nurturing, and creative.

Each style is fairly self-descriptive. For example, a person with a concise style uses as few words as possible to communicate, and may be seen as difficult to deal with because this person can be brusque. A person with an analytical style will ask lots of questions to gather information and must have all the facts to make a decision. A person with a nurturing style will be friendly, sensitive, and proper, and will expect courtesy when communicating with others. And a person with a creative style will be full of energy and ideas, but may have trouble staying on topic.

When it comes to communication styles, most people favor the styles that mirror their own. But to communication as effectively as possible with co-workers, and especially with difficult people, you may have to vary your communication style to match the other person’s style. Follow the two steps listed below to implement this strategy, so you can communicate successfully with difficult co-workers.

1. Determine the difficult person’s communication style.
You can determine the difficult person’s communication style by observing how he or she talks with others. Then simply match the characteristics the difficult person displays to the descriptions above to determine if the person uses a concise, analytical, nurturing, or creative communication style.

2. Communicate using a complementary style.
The second step, communicating using a complementary style, requires you to set aside your preferred communication style and adopt one that complements the difficult person’s style. If you need to work better with the concise communicator, first think about what he’s like: He wants you to speak in quick, succinct sound bites. If you take forever to get to the point, he’s going to become irritated. A lot of people find the concise communicator “difficult” and take this person’s brusqueness personally. If you want to communicate effectively with him, don’t let his behavior get to you. Instead, change the way you communicate with him. Be prepared, organized, brief, and confident.

Analytical communicators think linearly and often are conservative. They want to have all the facts before they make a decision. The word spontaneous probably isn’t in an analytical communicator’s vocabulary. And you may not find many analytical communicators at parties, since they prefer to keep to themselves. If you’re having problems dealing with an analytical communicator, be specific, don’t skip around, and be deadline-driven.

To communicate effectively with a nurturing communicator, you need to be friendly and polite, since friendliness and acceptance are important to this person. You can—and should—maintain boundaries with this type of communicator, but don’t be abrupt or rude. When dealing with this person, be positive, patient, and personable, schedule time to chat, and be sure to recognize the person’s achievements.

Getting the attention of a creative communicator is always the first step to communicating well with him. He’s a bundle of energy, and you’re going to have to crank up your energy level to keep up with him.

On the surface, none of the four communication styles necessarily presents an opportunity for difficulty. However, when someone has a style that differs from yours, it’s easy for you to begin to perceive that person as difficult. And when someone takes a style to an extreme, communicating with that person can definitely become difficult. To work effectively with this person, it pays to determine how he or she communicates, and then use a complementary style.

Communicating Clearly with Difficult People

——————————————————————————–

If you want to speak to be heard, then you must make sure that both your message and your intent are clear. This is particularly important when you’re communicating with a difficult person. You must take nothing for granted. To be certain your message is heard the way you want it to be heard, follow the four guidelines listed below.

1. Match your tone to your words.
Tone is important. If, for instance, you tell someone you’re happy to see her, but your tone is flat and unexpressive, she won’t believe your statement. She hears your tone, not your words. It’s a mixed message, and that’s poor communication. If you want to be heard, make sure the tone of your voice is in harmony with your message. If there’s a reason why there’s a clash between your tone and your words—you’re tired, for instance—explain that to your listener.

2. Clarify your message.
If you’re speaking to someone and you notice your message is not having the intended effect, then back up and clarify what you mean.

3. Express feedback in a positive way.
The minute most people hear something negative come out of your mouth, they stop listening and start preparing a defense. If you want a difficult person to change his behavior, you need to state your feedback as constructively as possible. You can use the following four strategies to provide positive feedback.

When offering feedback, use “I” statements, not “you” statements. If you speak for yourself, criticism is more acceptable. For example, say, “I feel…” and not “You should….”

Don’t speak in generalities. Instead, give specific examples of times the employee displayed inappropriate behavior. Then ask the person if he knows why his current behavior was unacceptable.

Explain how negative behavior is self-defeating. If you explain that negative behavior has negative personal consequences, like delaying a raise or promotion, then the difficult person has a better chance of understanding the long-term effect of his actions.

Offer new behavior options. Again, be specific. Difficult people sometimes have trouble understanding how to change, so be clear about possible solutions and their positive consequences.
4. Don’t allow interruptions.
Corrective suggestions aren’t always accepted by difficult people. They might fight your comments with a barrage of protests or insults. One way you can halt this interruption is to repeat the person’s name over and over. If Roger interrupts you and refuses to stop talking, simply keep saying, “Roger, Roger, Roger” in a calm voice. Eventually, Roger will quiet down to find out what you want, and you can proceed to make your point.
You could also hold up a hand and ask the difficult person to let you finish speaking. Or you could combine both of these suggestions: Say the person’s name, and then ask him to let you finish speaking before he responds.

Remember, when dealing with difficult people, if you follow the four guidelines listed above, and communicate your message clearly, you’ll be well on your way to effective communication.

Using Nonverbal Clues with Difficult People

——————————————————————————–

When communicating with a difficult person, words are not the only resources available to you. Nonverbal clues such as body language and facial expressions are a crucial part of getting your message across. You can establish rapport with a difficult person by using the following nonverbal ways to communicate.

Open and relaxed body language
Using open and relaxed body language is the first way to positively influence an interaction. Strong, confident indicators are open, uncrossed arms; hands clasped behind the back; and fast-paced walking with erect posture and swinging arms. Sitting on the edge of your chair, as opposed to slumping, indicates interest and attentiveness, as does moving your chair closer to the other person’s chair. If appropriate, loosening your tie or taking off your jacket also indicates that you’re relaxed, comfortable, and ready to proceed.

Body language should always be appropriate. If your boss is discussing a serious subject, for instance, swinging a leg over the arm of your chair doesn’t show relaxation; it indicates insolence or a disregard for the severity of the matter. When in doubt, mirror the body language of the person you’re with.

A good rule of thumb is to avoid negative body language such as crossing your legs or arms, clenching your hands or jaw, rubbing the back of your neck, or running your fingers through your hair.

Sometimes, defensiveness or fear of a new situation can cause someone to inadvertently use negative body language. In these instances, the person isn’t trying to be negative, but instead is just nervous or upset. Be aware of signs of nervousness, such as fidgeting hands, finger tapping, jangling pocket contents, lip biting, or head scratching.

Friendly facial expressions
The second way to positively influence an interaction is to use friendly facial expressions. Your facial expressions, especially the nonverbal messages revealed by your eyes, give others indications of your attitudes and feelings.

Remember, effective communication includes nonverbal clues such as open and relaxed body language and friendly facial expressions. Both of these tools will help you cope successfully with difficult people.

Listening Actively with Difficult People

——————————————————————————–

Most people, even difficult people, like to be heard. As a result, you should understand how to listen actively. The art of listening actively can pay dividends when working with a difficult person. To communicate more effectively, use the active listening strategies listed below.

1. Rephrase or repeat the speaker’s words.
One of the active listening strategies is to rephrase or repeat what the speaker just said. Eliminate preconceptions and listen. Once you’ve heard the person, repeat his or her words. This sends a message that you are listening and that you consider what the person says to be important.

2. Ask questions for clarification.
Another active listening strategy deals with clarifying the message you just heard. To clarify, ask questions like, “Who?” “What?” “Where?” “When?” “How?” and “Why?” These are open-ended questions designed to elicit more than just a simple “Yes” or “No” response. For example, ask “Who was involved?” not “Were several people involved?”

3. Confirm that you understood correctly.
This strategy can be used at any point during the conversation, but it’s especially good to use before concluding a conversation. For example, you could say, “Before we wrap up the meeting, let me just recap the pertinent points: We’re going to use light gray paper, and the brochures will be delivered next Monday, right?”

If you rephrase, clarify, and confirm what someone has said, that person will be less defensive, more open to communication, and hopefully less difficult.


Listening to the Voice of the Customer

June 17, 2007

Identifying Customers: The First Step to Success——————————————————————————–You may believe that you have only one kind of customer: the one who buys your goods and services. It is important to realize that a business typically has more than one type of customer. Therefore, it is crucial that you identify all your customers, including those inside and outside the organization. If you are focusing on a single customer’s concerns, you may be overlooking severe problems that other customers have.

The Six Sigma approach
Knowing exactly who your customers are helps you improve your offerings, because once you have identified your customers, you can begin to find out their needs. The Six Sigma guidelines will help you identify key customer categories, define steps for identifying customers, and learn how to apply these steps in your own organization.

Key customer categories
There are two key types of customers in any organization:

Internal customers—Internal customers are fellow employees in the organization who receive your goods and services. They might be your boss, employees in other departments who receive regular reports from you, or a subordinate or peer who seeks your expertise on a subject.

External customers—External customers are those outside the organization who may or may not pay for the goods you provide. While an external customer may be an end user, or paying customer, external customers may also be the retailers, resellers, and independent representatives in a supply chain.
Customers can be any individuals, groups, or organizations that receive your department’s or company’s products and services, whether or not they pay for them. Being able to prioritize customers is an advantage when satisfying these customers’ requirements.
Internal and external customers can be further categorized as one of the following:

Primary customers—This group has the most influence on whether the product or service is purchased or used.

Secondary customers—This group directly or indirectly uses your product or service and has significant influence on the purchasing decision.

Tertiary customers—This group directly or indirectly uses your product or service but has only some or little influence on the purchasing decision.
For example, in a customer chain for canned restaurant food, the distributor who buys the food is the primary customer; the restaurant who buys from the distributor is the secondary customer; the cook who prepares the food is the tertiary customer.
Identifying your specific customers
When a Six Sigma team identifies customers, it must identify all the customers for the process it hopes to improve. Once those customers are identified and categorized according to their influence on the process, the team can begin to devise ways to meet these customers’ specific needs.

Identifying customers is a four-step process:

Define the product or service.
Step 1 will help you think specifically about what you are offering. Ask yourself if this offering is a product or a service, or both. Then ask yourself which product, service, or combination of these you wish to focus on.

List all the users of the defined product or service.
Step 2 helps you identify and summarize your entire customer base. Include in your list every person, department, or organization that uses or touches your product or service.

Select the primary customer.
Step 3 involves selecting the primary customer. A primary customer has the most influence on whether the product or service is purchased or used, uses the offering the most, or uses the product or service first before the other customers.

Classify the remaining customers as secondary or tertiary customers.
In step 4, classify the remaining customers as either secondary or tertiary customers depending upon how much influence they have on whether the product or service is used, and how much they actually use the product or service themselves.
Six Sigma’s four-step customer identification technique helps project teams and other users be precise when selecting their customers. It also provides organizations with a simple yet effective way to identify which customers’ requirements need to be met. When using these steps, it is necessary to follow them in order.
The Six Sigma approach ensures that all customers will be classified according to their influence on and importance to the process being improved. When each step is correctly applied in the appropriate order, you enhance your ability to perform the step that follows. In turn, this helps you select the key customers for your product or service. Once you have identified who those key customers are, you are in a much stronger position to improve their product or service requirements.

——————————————————————————–
Course: Six Sigma: Listening to the Voice of the Customer
Topic: Identifying Your Customers


More about GC, Dispose and Finalize

June 17, 2007

I see questions regarding the GC on a daily basis. Finalize vs. Dispose is a popular topic. Let’s get it in the clear.
All of us .NET programmers make use of the Garbage Collector (GC) – some without knowing so. You have to familiarize yourself with the internals of the GC if you wish to create scalable components – there is no other option. Even though it does all its bits automagically, you can harness a lot of its power by understanding three basics: Finalize, Dispose, and the Destructor protocol in managed code. I will not be going into the finer details of how the GC does its job, but rather explain how you as a programmer can (and should) optimize your objects for the GC.
Finalize
When an object is instantiated, the GC allocates memory for it on the managed heap. If the class contains a Finalize method, the object is also enlisted in the “finalisation queue”. When this object is no longer needed, its memory will be reclaimed (freed) by the GC. If the object is enlisted in the finalization queue, its Finalize method will be called before discarding of the object. The purpose of the Finalize method is to release any resources (like a database connection, or a handle on a window) that might be in use by your object.
Since the GC decides when it is best to clean up objects (and it does a damn fine job in doing so!), you have no way of telling when exactly Finalize will be called. Finalize is also a protected member and can thus not be called explicitly. Does this mean that cleaning up your object is left entirely in the hands of the GC?
Dispose
Of course not. For increased performance, it is best to cleanup your unused resources immediately after using them. For instance, as soon as you have retrieved your data through a database connection, the connection should be discarded of since it eats up system resources like memory, which could be better utilized by objects that you do in fact need. For this reason, an object can implement the Dispose method (by implementing the IDisposable interface). Calling the Dispose method on an object does two things. Firstly, it cleans up any resources that were in use by your object. Secondly, it marks the object so that the GC would not call its Finalize method when it collects it – the resources have been cleaned up already in your Dispose method. This way, you save the overhead of the GC’s call to Finalize, and you can clean up your object at the most appropriate time.
How to implement Finalize and Dispose
Now that you know the reasons for these two methods, let’s see how to implement it.
In managed code, you cannot override or even call Finalize – it is implicitly generated (in IL) by the compiler if you have a destructor for your object. In other words, the following:

~MyClass
{
//Cleanup code here
}
Translates to the following:
protected override void Finalize()
{
try
{
//Cleanup of used resources
}
finally
{
base.Finalize();
}
}

As you can see, the method also calls Finalize on its parent type, and the parent type will call Finalize on its parent type – the whole hierarchy of your object is thus cleaned up. It is important to understand that you should only have a destructor for your class if it is really necessary, since calling Finalize, and enlisting objects that implement Finalize in the finalization queue by the GC, has significant performance implications.
The Dispose method is publicly callable. (I’ll explain the overload that accepts the boolean parameter later). Here is an example of an object that implements IDisposable:

public class MyClass : IDisposable, BaseClass
{
bool disposed; //Indicates if object has been disposed
//Constructor, where your resources might be instantiated
public MyClass()
{
disposed = false;
//Other Constructor code here
}

//Destructor, that would imply a Finalize method as noted above
~MyClass()
{
//Dispose is called, passing false, so that only
//unmanaged resources are cleaned up.
Dispose(false);
}

public void Dispose()
{
Dispose(true);
//Prevent the GC to call Finalize again, since you have already
//cleaned up.
GC.SuppressFinalize(this);
}

protected virtual void Dispose(bool disposing)
{
//Make sure Dispose does not get called more than once,
//by checking the disposed field
try
{
if (!this.disposed)
{
if (disposing)
{
//Clean up managed resources
}
//Now clean up unmanaged resources
}
disposed = true;
}
finally
{
base.Dispose(disposing);
}
}
}

When you explicitly call Dispose() on your object, both managed- and unmanaged resources will be cleaned up. When the GC cleans your object (instead of you), only unmanaged resources will be cleaned, since the managed resources will be cleaned up by the GC when necessary.
Final Notes
Don’t reference any managed resources in your Finalize method (destructor), since Finalizers are not called in any particular fashion, and the object you reference may thus be disposed of already. In such a case, your Finalize method will fail. If you *do* reference any managed resources downward in your object hierarchy, those objects will not be finalized with the current GC collection, and performance will suffer.
When calling any method on your object, it is necessary to first check if the object has been disposed. So a method in MyClass would look like this:
//In MyClass:

public void MyMethod()
{
if (this.disposed)
{
throw new ObjectDisposedException();
}
//Method code goes here
}

In a further article, I will dive deeper into the GC, and explain the implications of threading on your Finalize and Dispose methods.

In GC 101, I discussed the reasons for Finalize and Dispose, and how to implement these methods in your components. The C# language has some nice built-in functionality to help you with the Disposing pattern, which I will discuss here.
Cool C# feature: using
Consider the following code:
SqlConnection cn = new SqlConnection(cnString);
cn.Open();
//Use the open connection
cn.Dispose();
If an exception had to be thrown on the call to Open, Dispose will never get called, and your resource might leak. I’m sure you already know the solution:

try
{
SqlConnection cn = new SqlConnection(cnString);
cn.Open();
//Use the open connection
}
finally
{
cn.Dispose();
}

This code does exactly what the first listing does, but is safer – you are guaranteed that Dispose will be called. But, it is also much less readable! C# has a nice feature to help with readability here: the using clause. Our code can be rewritten as:

using (SqlConnection cn = new SqlConnection(cnString))
{
cn.Open();
//Use the open connection
}

Lovely, isn’t it? As soon as the using block exits, Dispose will automatically be called on all objects that implement IDisposable and are created with the using-clause. If you look at the compiler-generated IL, you will see that a try – finally is actually implemented.
Cool C# feature: foreach
You might have collections of expensive (disposable) objects from time to time. To ease coding against your collection, have it implement IDisposable:

internal class openDBConnectionsEnumerator : IEnumerator, IDisposable
{}
public class openDBConnections : IEnumerable
{
public IEnumerator GetEnumerator()
{
return new openDBConnectionsEnumerator();
}
}

Now, you can use your collection in a foreach loop, and Dispose is called automatically on your collection when the loop exits:

OpenDBConnections cons = new OpenDBConnections();
foreach(DBConnection in cons)
{
//Do something with connection object
} //Dispose is called on the IEnumerator when loop exits

Performance issues

The GC has only one thread that calls Finalize on all the objects in the finalization queue, and thus might have a tough time in keeping up with Finalizable objects created by more than one user thread. A shortened overview of a Finalizable object’s lifespan:

There are actions here that impacts negatively on performance:
1. Enlisting in the Finalization queue
2. Removing from Finalization queue to be enlisted in To Be Finalized queue
3. Calling Finalize on the component
4. Removing from To Be Finalized queue
It should be obvious that, if possible, the shortcut should be taken, and Finalizable components avoided. To do so, and this is quite important:
1. Don’t create Finalizers (or destructors) for your components unless absolutely necessary.
2. For components where you do need a destructor, always call Dispose on your component when appropriate. This suppresses the GC’s call to Finalize and saves you the overhead of calling Finalize and enlisting in the To Be Finalized queue.
Threading
A component’s Dispose(bool) method should never be called from both the GC’s finalizer thread and a user thread. There may be instances where more than one user thread calls the method. In this case, make your cleanup code thread safe in exactly the same way you’d make any code thread safe. If you are 100% sure that your code will not be called by more than one user thread at a time, don’t enforce thread-safety, as this impacts negatively on performance.
(You will also find this article on my blog).

Dispose, Part 3
Can I just let the GC get everything? When do I have to worry about Dispose?

If the object implements IDisposable then you should think about how the object is getting cleaned up.

Objects that implement IDisposable usually do so because they are holding on to real resources that should be freed deterministically. Rule of thumb:
If the object implements IDisposable then you should think about how the object is getting cleaned up.

When a control is disposed, it disposes all of its children. The only time you get automagic disposal of controls is when you do Application.Run(new Form()). (We like to call this showing the form modelessly). When the form gets WM_CLOSE message, it starts cleaning itself up while it can.

However if you do a Form.ShowDialog(), the form is NOT disposed. (We like to call this showing the form modally). This is because you may want to go in after the form has closed and look at the state of the child controls to determine the next action of your program.

If you add and remove controls from your form dynamically, you should call dispose on them – otherwise you’ll accumulate extra unwanted window handles in your process. Remember you only have to dispose the topmost control – so if you’re swapping in and out a panel – disposing the panel disposes it’s child controls.

Dispose is not just for controls though – Brushes, Pens, and Fonts implement IDisposable as well. These hold onto GDI objects, not window handles. If you leak these objects, it can cause quite a perf problem in your application as System.Drawing may start to GC extra times to get the number of handles back in check. SystemPens and SystemBrushes do not need to be disposed – these are cached objects. SystemFonts do as they are a live fetch from the OS of the current MenuFont etc.

However, if you are creating a new control that holds onto its own IDisposable object (e.g. it’s own tooltip), that control should override Dispose(bool disposing) and add calls to Dispose() for these objects.

If you are concerned about a leak in your code – bring up task manager, switch to processes. View->Select Columns and tick off USER objects and GDI objects. This should show you the live count of how many handles you have out.


http://msdn2.microsoft.com/en-us/3bwa4xa9.aspx

.NET Framework Developer’s Guide
Using Objects That Encapsulate Resources
When you write code that uses an object that encapsulates a resource, you should make sure that the object’s Dispose method gets called when you are finished using the object. You can do this with the C# using statement or by implementing a try/finally block in other languages that target the common language runtime.
C# Using Statement
The C# programming language’s using statement makes a call to the Dispose method more automatic, by simplifying the code that you must write to create and clean up an object. The using statement obtains one or more resources, executes the statements that you specify, and then disposes of the object. Note that the using statement is only useful for objects with a lifetime that does not extend beyond the method in which the objects are constructed. The following code example creates and cleans up an instance of the ResourceWrapper class, as illustrated in the C# example of implementing a Dispose method.

class myApp
{
public static void Main()
{
using (ResourceWrapper r1 = new ResourceWrapper())
{
// Do something with the object.
r1.DoSomething();
}
}
}

The preceding code, incorporating the using statement, is equivalent to the following.


class myApp
{
public static void Main()
{
ResourceWrapper r1 = new ResourceWrapper();
try
{
// Do something with the object.
r1.DoSomething();
}
finally
{
// Check for a null resource.
if (r1 != null)
// Call the object's Dispose method.
r1.Dispose();
}
}
}

The C# using statement allows you to acquire multiple resources in a single statement, which is equivalent internally to nested using statements. For more information and a code example, see using Statement (C# Reference).
Try/Finally Block
When you write managed code that uses an object that encapsulates a resource in languages other than C#, use a try/finally block to ensure that a call is made to the object’s Dispose method. The following code example creates and cleans up an instance of the Resource class, as illustrated in the Visual Basic example of implementing a Dispose method.


class myApp
Public Shared Sub Main()
Resource r1 = new Resource()
Try
' Do something with the object.
r1.DoSomething()
Finally
' Check for a null resource.
If Not (r1 is Nothing) Then
' Call the object's Dispose method.
r1.Dispose()
End If
End Try
End Sub
End Class

.NET Framework Developer’s Guide
Cleaning Up Unmanaged Resources

http://msdn2.microsoft.com/en-us/498928w2.aspx

You should prevent users of your application from calling an object’s Finalize method directly by limiting its scope to protected. In addition, you are strongly discouraged from calling a Finalize method for a class other than your base class directly from your application’s code. To properly dispose of unmanaged resources, it is recommended that you implement a public Dispose or Close method that executes the necessary cleanup code for the object. The IDisposable interface provides the Dispose method for resource classes that implement the interface. Because it is public, users of your application can call the Dispose method directly to free memory used by unmanaged resources. When you properly implement a Dispose method, the Finalize method becomes a safeguard to clean up resources in the event that the Dispose method is not called. For more information on correct implementation, see Implementing a Dispose Method.

A Finalize method acts as a safeguard to clean up resources in the event that your Dispose method is not called. You should only implement a Finalize method to clean up unmanaged resources. You should not implement a Finalize method for managed objects, because the garbage collector cleans up managed resources automatically. By default, the Object.Finalize method does nothing. If you want the garbage collector to perform cleanup operations on your object before it reclaims the object’s memory, you must override this method in your class.


Thread Safety

June 17, 2007

Collection Thread Safety

Public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

This implementation does not provide a synchronized (thread safe) wrapper for a CollectionBase, but derived classes can create their own synchronized versions of the CollectionBase using the SyncRoot property.

Enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.

http://msdn2.microsoft.com/en-us/library/system.collections.collectionbase(VS.80).aspx


The philosophy of William Edwards Deming

June 17, 2007

Deming philosophy synopsis

The philosophy of W. Edwards Deming has been summarized as follows:

“Dr. W. Edwards Deming taught that by adopting appropriate principles of management, organizations can increase quality and simultaneously reduce costs (by reducing waste, rework, staff attrition and litigation while increasing customer loyalty). The key is to practice continual improvement and think of manufacturing as a system, not as bits and pieces.”[13]
In the 1970s, Dr. Deming’s philosophy was summarized by some of his Japanese proponents with the following ‘a’-versus-’b’ comparison:

(a) When people and organizations focus primarily on quality, quality defined by the following ratio:
,
then quality tends to increase and costs fall over time.
(b) However, when people and organizations focus primarily on COST, then costs tend to rise and quality declines over time.
[edit]
The Deming System of Profound Knowledge™
“The prevailing style of management must undergo transformation. A system can not understand itself. The transformation requires a view from outside. The aim of this chapter is to provide an outside view-a lens-that I call a system of profound knowledge. It provides a map of theory by which to understand the organizations that we work in.

The first step is transformation of the individual. This transformation is discontinuous. It comes from understanding of the system of profound knowledge. The individual, transformed, will perceive new meaning to his life, to events, to numbers, to interactions between people.

Once the individual understands the system of profound knowledge, he will apply its principles in every kind of relationship with other people. He will have a basis for judgment of his own decisions and for transformation of the organizations that he belongs to. The individual, once transformed, will:

Set an example
Be a good listener, but will not compromise
Continually teach other people
Help people to pull away from their current practice and beliefs and move into the new philosophy without a feeling of guilt about the past
The layout of profound knowledge appears here in four parts, all related to each other:

Appreciation for a system
Knowledge about variation
Theory of knowledge
Psychology
One need not be eminent in any part nor in all four parts in order to understand it and to apply it. The 14 points for management in industry, education, and government follow naturally as application of this outside knowledge, for transformation from the present style of Western management to one of optimization.

The various segments of the system of profound knowledge proposed here can not be separated. They interact with each other. Thus, knowledge of psychology is incomplete without knowledge of variation.

A manager of people needs to understand that all people are different. This is not ranking people. He needs to understand that the performance of anyone is governed largely by the system that he works in, the responsibility of management. A psychologist that possesses even a crude understanding of variation as will be learned in the experiment with the Red Beads (Ch. 7) could no longer participate in refinement of a plan for ranking people.”[8]

**************************************

Deming’s 14 points

Deming offered fourteen key principles for management for transforming business effectiveness. In summary:

Create constancy of purpose for the improvement of product and service, with the aim to become competitive, stay in business, and provide jobs.
Adopt a new philosophy of cooperation (win-win) in which everybody wins and put it into practice by teaching it to employees, customers and suppliers.
Cease dependence on mass inspection to achieve quality. Instead, improve the process and build quality into the product in the first place.
End the practice of awarding business on the basis of price tag alone. Instead, minimize total cost in the long run. Move toward a single supplier for any one item, based on a long-term relationship of loyalty and trust.
Improve constantly, and forever, the system of production, service, planning, of any activity. This will improve quality and productivity and thus constantly decrease costs.
Institute training for skills.
Adopt and institute leadership for the management of people, recognizing their different abilities, capabilities, and aspiration. The aim of leadership should be to help people, machines, and gadgets do a better job. Leadership of management is in need of overhaul, as well as leadership of production workers.
Drive out fear and build trust so that everyone can work more effectively.
Break down barriers between departments. Abolish competition and build a win-win system of cooperation within the organization. People in research, design, sales, and production must work as a team to foresee problems of production and use that might be encountered with the product or service.
Eliminate slogans, exhortations, and targets asking for zero defects or new levels of productivity. Such exhortations only create adversarial relationships, as the bulk of the causes of low quality and low productivity belong to the system and thus lie beyond the power of the work force.
Eliminate numerical goals, numerical quotas and management by objectives. Substitute leadership.
Remove barriers that rob people of joy in their work. This will mean abolishing the annual rating or merit system that ranks people and creates competition and conflict.
Institute a vigorous program of education and self-improvement.
Put everybody in the company to work to accomplish the transformation. The transformation is everybody’s job.
[edit]
Seven Deadly Diseases
The Seven Deadly Diseases:

Lack of constancy of purpose.
Emphasis on short-term profits.
Evaluation by performance, merit rating, or annual review of performance.
Mobility of management.
Running a company on visible figures alone.
Excessive medical costs.
Excessive costs of warranty, fueled by lawyers who work for contingency fees.
A Lesser Category of Obstacles:

Neglect of long-range planning.
Relying on technology to solve problems.
Seeking examples to follow rather than developing solutions.
Excuses such as “Our problems are different”.

*************************************************************

Quotations and concepts
In his later years, Dr. Deming taught many concepts, which he emphasized by key sayings, or quotations that he repeated. A number of these quotes have been recorded. [14] Some of the concepts in Deming’s quotations might seem to be an oxymoron or contradictory to one another; however, the student is encouraged to reflect about the meaning over time.

“What is a system? A system is a network of interdependent components that work together to try to accomplish the aim of the system. A system must have an aim. Without an aim, there is no system. The aim of the system must be clear to everyone in the system. The aim must include plans for the future. The aim is a value judgment. (We are of course talking here about a man-made system.)”[9]
“A system must be managed. It will not manage itself. Left to themselves in the Western world, components become selfish, competitive. We can not afford the destructive effect of competition.”[10]
“To successfully respond to the myriad of changes that shake the world, transformation into a new style of management is required. The route to take is what I call profound knowledge – knowledge for leadership of transformation.”[11]
“The problem is at the top; management is the problem” [15], “Management’s job. It is management’s job to direct the efforts of all components toward the aim of the system. The first step is clarification: everyone in the organization must understand the aim of the system, and how to direct his efforts toward it. Everyone must understand the damage and loss to the whole organization from a team that seeks to become a selfish, independent, profit centre.”[12]
“They realized that the gains that you get by statistical methods are gains that you get without new machinery, without new people. Anybody can produce quality if he lowers his production rate. That is not what I am talking about. Statistical thinking and statistical methods are to Japanese production workers, foremen, and all the way through the company, a second language. In statistical control you have a reproducible product hour after hour, day after day. And see how comforting that is to management, they now know what they can produce, they know what their costs are going to be.”[13]
“I think that people here expect miracles. American management thinks that they can just copy from Japan—but they don’t know what to copy!”[14]
“What is the variation trying to tell us about a process, about the people in the process?”[15] Dr. Shewhart created the basis for the control chart and the concept of a state of statistical control by carefully designed experiments. While Dr. Shewhart drew from pure mathematical statistical theories, he understood data from physical processes never produce a “normal distribution curve” (a Gaussian distribution, also commonly referred to as a “bell curve”). He discovered that observed variation in manufacturing data did not always behave the same way as data in nature (Brownian motion of particles). Dr. Shewhart concluded that while every process displays variation, some processes display controlled variation that is natural to the process, while others display uncontrolled variation that is not present in the process causal system at all times.[16] Dr. Deming renamed these distinctions “common cause” for chance causes and “special cause” for assignable. He did this so the focus would be placed on those responsible for doing something about the variation, rather than the source of the variation. It is top management’s responsibility to address “common cause” variation, and therefore it is management’s responsibility to make improvements to the whole system. Because “special cause” variation is assignable, workers, supervisors or middle managers that have direct knowledge of the assignable cause best address this type of specific intervention.[17]
(Deming on Quality Circles) “That’s all window dressing. That’s not fundamental. That’s not getting at change and the transformation that must take place. Sure we have to solve problems. Certainly stamp out the fire. Stamp out the fire and get nowhere. Stamp out the fires puts us back to where we were in the first place. Taking action on the basis of results without theory of knowledge, without theory of variation, without knowledge about a system. Anything goes wrong, do something about it, overreacting; acting without knowledge, the effect is to make things worse. With the best of intentions and best efforts, managing by results is, in effect, exactly the same, as Dr. Myron Tribus put it, while driving your automobile, keeping your eye on the rear view mirror, what would happen? And that’s what management by results is, keeping your eye on results.”[18]
“Knowledge is theory. We should be thankful if action of management is based on theory. Knowledge has temporal spread. Information is not knowledge. The world is drowning in information but is slow in acquisition of knowledge. There is no substitute for knowledge.”[19] This statement emphasizes the need for theory of knowledge (see: epistemology, Shewhart cycle, C. I. Lewis). It is considered as a contrast to the old statement, “There is no substitute for hard work” by Thomas Alva Edison (1847-1931).
“Experience by itself teaches nothing”, “Without theory, experience has no meaning. Without theory, one has no questions to ask. Hence without theory there is no learning.”[20] These statements emphasize the need to interpret information using a theory or framework of concepts for learning to take place, theory of knowledge. It is considered as a contrast to the old statement, “Experience is the best teacher” (Dr. Deming disagreed with that). To Dr. Deming, knowledge is best taught by a master who provides sound theory through which experience is interpreted; experience, without theory, is raw data that will be not be understood. Deming’s view of experience is related to Shewhart’s concept, “Data has no meaning apart from its context” (see Walter A. Shewhart, “Later work”).
“The most important figures that one needs for management are unknown or unknowable (Lloyd S. Nelson, director of statistical methods for the Nashua corporation), but successful management must nevertheless take account of them.”[21] Deming realized that many important things, that must be managed, couldn’t be measured. Both points are important. One, you can’t measure everything of importance to management. And two, you must still manage those important things. Spend $20,000 training 10 people in a special skill. What’s the benefit? “You’ll never know,” answered Deming. “You’ll never be able to measure it. Why did you do it? Because you believed it would pay off. Theory.” Dr. Deming is often incorrectly quoted as saying: “you can’t manage what you can’t measure.” In fact, he stated one of the seven deadly diseases of management is running a company on visible figures alone.
“By what method?” [16] When information is obtained, or data is measured, the method, or process used to gather information, affects the results. Dr. Deming warned that basing judgments on customer complaints, alone, ignored the general population of other opinions, which should be judged together, such as in a statistical sample of the whole (Sampling frame). Changing the method changes the results. Aim and method are essential. An aim without a method is useless. A method without an aim is dangerous. It leads to action without direction, and without constancy of purpose. Deming used an illustration of washing a table to teach a lesson about the relationship between purpose and method. If you tell someone to wash a table, but not the reason for washing it, they cannot do the job properly. That does not mean just giving the explanation without an operational definition. The information about why the table needs to be washed, and what is to be done with it makes it possible to do the job intelligently.