SQLServerCentral - www.sqlservercentral.com

A community of more than 1,600,000 database professionals and growing

Featured Contents

Featured Script

The Voice of the DBA

Team Reputation

Today we have a guest editorial as Steve is traveling.

Ever thought about how your team is perceived by other teams or by other customers, internal or external? I think most of us focus on two things – the reputation of the company and our individual skills and experience – when we’re job seeking, and I think that makes sense. But is it enough? Does it make a difference how the team you’re joining is thought of?

When I arrived at my first assignment in the military years ago I was everything you’d expect – curious, excited, all the rest. Then I got to my platoon and found out that they (we) were restricted to the barracks. Why? They had been fighting. On the parade ground. At night. In their underwear. With each other! It took a while for that stain to wear off and until it did, no matter how good I was, I was only as good as the reputation of the team I was on.

Since then I’ve worked on a lot of teams. The best team I worked on was three of us, arguably each the best at what we did in our respective areas across a very large organization. We worked hard, we built relationships, and that translated into a lot of respect and lee way. I worked with a team for a while that was treated as overhead, with the goal of reducing that overhead still more – not fun. Most teams have had pretty good people, but many of them have struggled with the reputation part.

Reputation often stems more than you might expect from whoever leads the team. Yes, the team has to deliver, but the team tends to reflect the attitude and approach and values of the manager. If the manager has a good reputation then usually the team does.

There are often opportunities to be found on bad/failing teams, but it’s never as fun as joining a team that has a great reputation. It’s hard to assess during the interview, but worth a try. To some degree you can tell by the interview itself, the things they focus on and how they treat you, but it’s not the same as finding out how the rest of the world sees the team.

Does your team have a good reputation? How important do you think team reputation is to enjoying work? Got a good horror story about a bad team? Let’s continue this in the discussion forum.

Andy Warren from SQLServerCentral.com

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

ADVERTISEMENT
SQL Source Control

24% of devs don’t use database source control – make sure you aren’t one of them

Version control is standard for application code, but databases haven’t caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out…

SQL Data Compare

Compare and synchronize database contents

“This operation normally takes me hours. With SQL Data Compare, it took me no more than minutes.” Jan Hansen, Database Architect. Download a free trial.

Performance Tuning with DMVs free eBook

Free eBook - Performance Tuning with DMVs

This free eBook by Louis Davidson and Tim Ford provides you with the core techniques and scripts to monitor your query execution, index usage, session and transaction activity, disk IO, and more. Download the free eBook.

Featured Contents

 

Getting Started in SQL Server

Craig Farrell from SQLServerCentral.com

Preparing for your first (or next) interview or job in SQL Server. A good introduction from Craig Farrell. More »


 

High Performance Relational Division in SQL Server

Additional Articles from SimpleTalk

Relational division is used in SQL to select rows that conform to a number of different criteria. Dwain Camps explains how to use it, and shows the performance gains. More »


 

SQL Monitor Custom Metric: Server principals with default database offline

Press Release from Red-Gate

This metric monitors whether a server principal’s default database is offline. When you create a SQL Server server principal (formerly referred to as a server login) it has a default database setting that is used to assist in a connection request when no database is specified. More »


 

From the SQLServerCentral Blogs - Book: Reporting with Microsoft SQL Server 2012

I am happy to say I have published my first book!  It is called Reporting with Microsoft SQL Server 2012... More »

Question of the Day

Today's Question (by free mascot):

Is it possible to create more than 1 distribution database for replication on a SQL instance i.e. distribution, distribution1 etc. on SQL Server 2012?

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


We keep track of your score to give you bragging rights against your peers.
This question is worth 2 points in this category: Replication.

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

ADVERTISEMENT

Expert Performance Indexing for SQL Server 2012

Expert Performance Indexing for SQL Server 2012 is a deep dive into perhaps the single-most important facet of good performance: indexes, and how to best use them. The book begins in the shallow waters with explanations of the types of indexes and how they are stored in databases. Moving deeper into the topic, and further into the book, you will look at the statistics that are accumulated both by indexes and on indexes. All of this will help you progress towards properly achieving your database performance goals.

Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Anoo S Pillai):

How many rows would be outputted from the select statement with 'tablesample' clause given below? 


USE TempDB
go 
CREATE TABLE #Emp
    (
      empID INT
    , eName VARCHAR(100)
    )
go 
INSERT INTO #Emp
        ( empID, eName )
    VALUES ( 1, 'eName1' ) 
INSERT INTO #Emp
        ( empID, eName )
    VALUES ( 2, 'eName2' ) 
INSERT INTO #Emp
        ( empID, eName )
    VALUES ( 3, 'eName3' ) 
INSERT INTO #Emp
        ( empID, eName )
    VALUES ( 4, 'eName4' ) 
INSERT INTO #Emp
        ( empID, eName )
    VALUES ( 5, 'eName5' ) 
go 
SELECT empid
      , ename
    FROM #Emp TABLESAMPLE (4 ROWS)
go

Answer: 0 or 5

Explanation:
Even when ROWS option is applied, TABLESAMPLE clause does not select data row by row, instead each 8-KB physical page is included or excluded entirelly. If data fits into a single page and if TABLESAMPLE clause includes that page for output , all the rows in that page would be outputted - in this case 5. If that page is excluded by TABLESAMPLE, zero rows would be outputted.
Note:- When number of rows is specified with TABLESAMPLE, that number is converted into a percentage of the rows, and TABLESAMPLE operation is performed with that computed percentage.

For further details, please refer http://technet.microsoft.com/en-us/library/ms189108(v=sql.105).aspx


» Discuss this question and answer on the forums

Featured Script

Quick snapshot

Igor Micev from SQLServerCentral.com

/*
Snapshot script:
The script enables a quick creation of snapshots for databases. 
It has two run modes defined by the optional parameter @exec_mode.
 @exec_mode=0 (default) means printing the create snapshot statment and
 @exec_mode=1 means creation of the snapshot database.
 @database is mandatory input parameter.
Tested on SQL Server 2005, 2008, 2012.
Usage:
EXEC [dbo].[Create_UserDb_Snapshot] @database = 'AdventureWorksDW2012'
EXEC [dbo].[Create_UserDb_Snapshot] @database = 'AdventureWorksDW2012', @exec_mode=0
EXEC [dbo].[Create_UserDb_Snapshot] @database = 'CWNET', @exec_mode=1
Date created: 2014-Mar-12
Author: Igor Micev (igor.micev@hotmail.com; igor.micev@outlook.com)
*/

More »

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.

SQL Server 2014 : Administration - SQL Server 2014

Ideal table for Memory Optimization ? - I have a simple id, name table with six million records, that i converted to a "memory optimized' table. It now...


SQL Server 2014 : Development - SQL Server 2014

Memory Optimized tables - large data sets - Hi - I'm testing SQL 2014 - in particular, memory optimized tables. We loaded the memOptimized tables (2 Billion rows) from replica...

Database and its Objects Naming Standards - I am trying to establish the standards for naming convention in my new project. Can you please provide me the...


SQL Server 2012 : SQL 2012 - General

Maintenance Plan - Show Successful even if a Task fails, is this possible? - Our backups by default go to a network location, but I'd like to modify our maintenance plans to backup to...

SSIS Data Flow Items tab missing in the SSDT 2010 for SSIS 2012 - Hi, I need to see inside a SSIS 2012 project a new SSIS installed component, but in the SSDT 2010 I...

SSIS Package - FTP Task fails when run from a job - We are running SQL Server 2012 SP1 64-Bit EE on Windows Server 2008 R2 SP1. I have a SSIS Package...

AlwaysOn Availability Group on SQL Developer Edition - I'm trying to setup a testing lab to test the AlwaysOn feature and my question is could I set this...

remove digits - i have table like name 22rajuvar 45 vamsgui 87 praveen 67kumar 32 vamshi above field mix with digits and charcter i want to remove digits i want...

dumping fields in a single column of database.. is this a right way to achieve performance in sql.. - Hello All While working with a vast variety of support projects, i find a sql design where all the fields in...

SQL Statement not displaying results with zero value - Hello, I am currently working on a project to display the pricing of our products, as mentioned above though the discount...

Data compression in SQL - Where can I get detailed notes on "Data compression in SQL server"?It would be helpful if the notes are accompanied...

COMPARE TWO TABLES COPY MATCHING VALUS TO TABLE_C - i have 3 table table_A table_B table_C TABLE_A SNO NAME ID 1 RAJU [b] 070491[/b] 2 VAMSHI 089767 3 ARUNA 068908 TABLE_B SNO NAME ID 2 RAJU [b] 070491[/b] 4...

SQL Server Audit not tracking ALTER or DROP, just CREATE statements - We're looking to Audit DDL statements against a specific database as a double-check that our schema objects aren't "drifting" prior...


SQL Server 2012 : SQL Server 2012 - T-SQL

T-SQL options - I feel like this should be easy but my T-SQL is a little rusty so I'm looking for suggestions. Hopefully,...

simple looping question - Hi I want to loop through rows and append values to a declared variable. The example below returns nothing from Print...

T-SQL Equivalent for PL-SQL - Hi All, Thanks for looking in to my question. I need a T-SQL (SQL Server) equivalent code for the PL/SQL (Oracle)...

Migration from 2008R2 to 2012, linked servers error - Hi! We are preparing to migration from 2008R to 2012 and we encountered with query errors to Oracle linked servers. This query...

Simple Inner Join Question - When performing an inner join is it better to do this --Query 1 SELECT sd.CarrierTrackingNumber, sd.LineTotal, sh.CustomerID, sh.DueDate FROM AdventureWorks2012.Sales.SalesOrderDetail sd INNER JOIN AdventureWorks2012.Sales.SalesOrderHeader sh ON sd.SalesOrderID = sd.SalesOrderID Or do...


SQL Server 2008 : SQL Server 2008 - General

Can composite indexes be used as an index on a single field? - I've got a table that has a composite index on three of its fields. I don't want to create another...

DDL Triggers and exec privilege - I have created a DDL Trigger in order to track who creates/modifies/deletes SP and Tables CREATE TRIGGER DDLTrigger_OBJECT --ALTER TRIGGER DDLTrigger_OBJECT ON...

Operanda datattype error - Hi, I am using this query to sum two column REPLACE( CONVERT(VARCHAR(32),cast(round(isnull(sum(R1.[OBM Dollars] + R.[Current Cost]),0),0)as MONEY),1), '.00', '') as [Total Cost], But I...

Multiple duplicates - Pls help me My Table looks like Track | Books ----------------- 204 | A 204 | B 204 | B 204 | C 206 | A 204 | A ...

Dynamic Pivoting in sql - Hi all, I want a help for a dynamic pivoting for columns, I am struck with it. I want this dynamic...

Process Blocking - Hi all, Just a quick question out of curiosity really.... Occasionally I see the following scenario in Activity Monitor: Process 1 is blocked...

How a query uses an index - I have a table with what I would consider way too many indexes on it (35 - and the table isn't...

Keylookup - Good Day. I executed a query and in its execution plan I saw a Keylookup and in the output I...

SQL server is takes all memory - While inserting the data cpu usage goes high. From the front end we are just inserting the data to the table....

Visual formatting of data returned from a SAP database - Hi Everyone, I am working with extracting data from a SAP database, and I would like to perform some 'visual formatting'...

decrease the size of log file - one of the tlog file is configured as initial 1 TB , because of that we doint have space on the...

Convert "TinyInt" into Binary format and store the multiple bit values in columns - Hi team, I have an requirement which I need expertise help on how to write the logic. Our system records the appointment...

how to do duration in hours with ragged data - Is there any convention for how to get from the left hand column (Hours) to the right hand column (Hours...

98% Memory usage SQL Server 2008 R2 - Been monitoring SQL server 2008 for a bit now and seems the memory usages sits between 95-95% memory usage. After...

logical consistency-based I/O error - SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 4:1738920; actual 256:10100480). It occurred during a read of...

SQL SERVICE WON'T START - While trying to move the MSDB and Model DB, I mistakenly ran the following ALTER DATABASE model MODIFY FILE (NAME = modelData, FILENAME...

Get the hierarchy orders(top to bottom) of the table - Can we get the hierarchy orders of table Eg: 10 tables Table1 is master to table2 and so on till table10 Just...

Flexible Recursive Level Splitting - One column per level - Hi All, see code below, using a small sample of data. I have a table that is formed like Id/ParentId/Name, but I...

MDW Database bloats; Purge job runs continuously - Hi All, I have a SQL 2008 R2 Enterprise instance (named SQLUTILITY) which is monitoring six other SQL 2008 R2...


SQL Server 2008 : T-SQL (SS2K8)

"Arithmetic overflow error converting varchar to data type numeric" message when field is decimal - I am trying to setup an indicator value for an SSRS report to show green and red values on a...

generate random value before @ in email address - Hello, Here is my table, [sup]CREATE TABLE test_43(id int, email varchar(50)) INSERT INTO test_43 VALUES (1, 'testing1@sql.com') INSERT INTO test_43 VALUES (2, 'testing2@sql.com') SELECT * FROM...

SQL Service Broker Internal Activation Questions - Hi All, I setup [b]Internal Activation[/b] for two existing stored procedures. One, inserts one or more records , the other, updates one...

help needed to come up with logic - we have in the application 4 fields There is one field called Description and this field is non editable . Now what...

Wait + looping - Hi all, We will soon be migrating to SS2K8, and before we cutover we need take our DB's offline/into Single...

Order by tweak - Hello Please help me, i have a table with 500k rows, need to split into 3 sets(please assume need to insert...

Help need in Avoiding Loop - Hi, Here is my table structure: [code="sql"] ;with Users as ( select 1 as UserId, 2 as PendingAmount,10 as AvailableAmount union all select 2 as...


SQL Server 2008 : SQL Server Newbies

decrypt to date datatype - I accidentally used date data type (rather than datetime) to encrypt a column. As I understood from online research, that...

DB2OLEDB driver problem - Hi, i have a stored procedure which uses the DB2OLEDB driver which i use to connect to an AS400 database....

Exporting Column Headers to Excel - Hi Guys, I have to complie a list of column names and their data types in excel, is there anyway to...


SQL Server 2008 : Security (SS2K8)

Malicious files on the sql server found - Hi All, I need some help on how can we get the details and confirm that if some one view or...


SQL Server 2008 : SQL Server 2008 High Availability

Backup Not Truncating Logs after Putting in Replication - We are currently running SQL Server 2008 R2. One of our business processes dictated that we replicate data from 2...


SQL Server 2008 : SQL Server 2008 Administration

fn_dblog - Hi Experts, Will the below statement cause any issue on database?? DECLARE @TableName sysname SET @TableName = 'dbo.ARA' SELECT u.[name] AS UserName , l.[Begin Time] AS...

Opinion of use of LINQ - I have a new developer that recently started. He is using LINQ and he approached me on some performance\connectivity issues which...

Help on Monitoring - Hi Experts, This question is related to monitoring of sql server. 1. I want to send an email alert with all open...

Tables Huge cache size in memory? - Hi, Table Name: Result Actual Row count - 10798010 Cached_MB in memory - 4759 and Index-Id - 1 (it is primary key clustred Index) This table accoupied...

How to go about building new reliable SQL Server ? - Hi Everyone, I need help on this. Basically I am looking for typical questionnaire which can be asked to customers/clients when they...

Linked Server and MSSQL Job - Hi, i have a stored procedure which uses the DB2OLEDB driver which i use to connect to an AS400 database....

Suiggestiosn For Choosing The Partition Key - Hello All, I need some guide lines to choose a proper partitioning key for tha tables. LIke below: What Data type should...

Weird problem in database backups - Got a bit of an odd one here. A client has SQL 2008 R2 Express installed to support our product--since...

Data Deletion!! - Hi Experts, Every midnight 1 row is getting deleted from a particular table. Is there anyway to trace how it happens? I...

upgrade from SQL server 2005 to 2008R2 - We have 1 SQL server 2005 sp2 server, we would like to upgrade it to SQL server 2008 R2. We are...


SQL Server 2008 : SQL Server 2008 Performance Tuning

Weird I/O Problem with server - Across my environment we are seeing sporadic issues appear on our database servers. The issue first appeared about 4 months...

SQL server disk I/O related question - Hi Experts, I have a question on disks. How much I/O can a normal disk and a SAN disk can handle? I have...

Performance Issues with Query - I have a view which takes date as one of its parameters and a list of 1000 codes passed with...

PAGEIOLATCH_EX and Blocking - Hello, Last week one of my application team member complained saying that the application is behaving slow when he is running...

Consolidating Indexes - Hi Guys, I have an index consolidating issue which I have not been able to find a definitive answer to. I have...

LINQ vs SQL Questions - I've run into issues in the past dealing with extremely poorly written queries with LINQ. I've been under the impression...


SQL Server 2005 : Administering

Mirroring Configuration - Hello, I am enabling Service Broker on a mirrored database so am going to break the mirror before doing so. Another...

SQL Server Agent : Job Failure - Hello, I wish to put the result of a query in Excel then send it to a number of persons at...


SQL Server 2005 : Backups

Backup failure - Need your help to resolve below error. Error:- Unable to start execution of step 1 (reason: The SSIS subsystem failed to...


SQL Server 2005 : Business Intelligence

using dtutil in ssis2008 - I would like to know how to check for existing ssis package in file system for example in c drive...

loading multiple file types into one table - We have scenario where we want to load different types of files(csv, xls, txt) into one table using SSIS. How can...


SQL Server 2005 : Development

Triggers Examples - Hi, Can any one send me the simple examples of using Instead of Trigger and After Trigger with Northwind database...


SQL Server 2005 : SQL Server 2005 Integration Services

SSIS Task to Tell if Any Files Exist in Any Subfolder Within a Root Folder? - Seems extremely simple but I'm not getting anywhere. I have a folder that clients can drop files into from day to...

How to Tell If At Least 1 File Exists in A Collection of Subfolders - This seems very simple but I'm drawing a blank... I want start up an SSIS 2005 package and first check a...


SQL Server 2005 : T-SQL (SS2K5)

Best approach for Data transfer of large number of rows - Hello, we have our database in sql 2005 version Enterprise Edition . Because of performance issue we have normalized database and...

Nesting xml - Hello, I am working on xml from SS2k12 results. I can get it to work with for xml auto; elements but...


Reporting Services : Reporting Services

No users can Print SSRS reports - They get Error loading resource library. (0x8007007E). deleted rsclientprint*.* from windows/system and windows/ reinstalled to c:\windows\downloaded program files\ Still the same...

Credentials are not required error - Hi everyone, Error: The report server has encountered a configuration error. I don't know why getting error, I have created...

Divide By zero error - Hi All, I have this expression : ((Fields!Number_of_Instalments.Value - 1)* Fields!Admin_Fee.Value)+ (Fields!Admin_Fee.Value / Fields!Monthly_Payment.Value * Fields!Final_Amount.Value) The issue is that where the monthly Payment is 0,...

Keeping the headers in each tab in SSRS 2008 - Anyone have a fix for this one? We're trying to run a report and have a page break on the city...

Stored procedure returns proper results but report preview won't if... - I have a stored procedure that accepts two float parameter values used to filter results. I want to allow the...

MS Access vs SSRS - impact on SQL Server - Hi My current employer has a slew of homemade reporting using MS Access. At times, these reports place a great deal...

Stored Procedure for Data Driven Subscription? - I've found that the T-SQL I want to use for a data driven subscription isn't considered valid by the RS...


Reporting Services : Reporting Services 2008 Development

Formatting the number in SSRS - Hello, How to set the number from 3296317 to 3,296,317 After going to text box properties -> clicking on number how...

Converting calendar date into fiscal year - Hi I am in R3 SSRS and adding a new field by converting calendar date into Fiscal Year, i.e. 2014-15. I used...


Programming : XML

XSLT sum and xpath - I am trying to sum the costs values in this sample xml using the xslt below. I expect to see...


Programming : Testing

Raspberry PI as test box - Woke up and sprained my brain this morning. That's the only reason I can think of as to why this...


Data Warehousing : Integration Services

SSIS Teradata package - I am executing an SSIS package which pull data from an .xls spreadsheet and loads into Teradata table. The package...

Third Party Component on different server - Hi, I want to use a third party component in my SSIS package but I don't want to install it on...

Checking other 5 other columns for change and if they have set field null - Hi , Columns in source Address1 Address2 Address3 Address4 Address5 Columns in destination Address_1 Address_2 Address_3 Address_4 Address_5 City I'm using a conditional split to checking if the data has changed between...

source code control for dtsx - Guys, We are about to embark on a large scale data warehousing project which will be run mainly on SSIS 2012....

importing to SQL Server from .txt - Using SSIS, I'm importing a .csv flat file source having 7 columns into a SQL Server table destination. To avoid...


Data Warehousing : Strategies and Ideas

DW Data Model - Financial services - Hello, we are creating a new DW at our firm. I have several questions. The first one is In regards to...


Database Design : Hardware

Placement of SQL Server Data and TLog files in a SAN Infrastructure and Monolith Storage Environment - Hi Everyone, The reason for my post is to get others opinions, thoughts, and any facts regarding the placement of SQL...


SQLServerCentral.com : Anything that is NOT about SQL!

Today's Random Word! - HI When you woke up today, or logged-onto Opera Forums, you may have had a dream, a thought, a scene...

Are the posted questions getting worse? - Is it me, or are the posted questions getting worse these days? I just read a post by someone apparently in...


SQLServerCentral.com : Editorials

What is your organization doing about your physical security in your IT organization? - I have been listening to the reports from Fort Hood last night and this morning. And I've been thinking that...


SQLServerCentral.com : SQLServerCentral.com Website Issues

Not receiving daily newsletters - Has anyone else stopped receiving the daily newsletters via email? The last one I got was Friday 15th Nov.


SQL Server 7,2000 : General

Memory configuration - Hi, What is the max memory support for SQL server 2000(32 bit) when i came across technet i got this information Operating System ...


SQL Server 7,2000 : T-SQL

Stored procedure to join two table. - I want to write fetch data through stored procedure where we have to join two table. for example in i...

Query to list the service accounts ? - I have to go through a lot of SQL severs to get the service accounts running each service, it would...

This email has been sent to {user_email}. To be removed from this list, please click here.
If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com.
This newsletter was sent to you because you signed up at SQLServerCentral.com.
Feel free to forward this to any colleagues that you think might be interested.
If you have received this email from a colleague, you can register to receive it here.
This transmission is ©2014 Red Gate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com