In this issue

Featured Contents

Editorial

Featured Script

 
 advertisement
 
SQL Source Control No source control system needed to evaluate SQL Source Control
The evaluation repository makes it easy to try SQL Source Control. Get started with the 28-day free trial.
 
sqlmonitor What can SQL Monitor 3.2 monitor?
Whatever you think is most important. Use custom metrics to monitor and alert on data that's most important for your environment. Find out more.
 
SQL Skills SQLskills Immersion Events - Deep SQL Server Training
Deep technical training by world-renowned experts in Bellevue, WA in August 2012. You can't get better ROI for your training budget. Learn more.

In This Issue

Stairway to SQL PowerShell Level 3: Input and Output with PowerShell

This level will cover some of the Input/Output operations you can use with PowerShell.  More »


SQL in the City - San Francisco 2012

The city by the bay welcomes Steve Jones, Grant Fritchey and more for a day of debate, discussion and learning about SQL Server. It's free. Just register and join us. More »


The Seven Sins against T-SQL Performance

There are seven common antipatterns in T-SQL coding that make code perform badly, and three good habits which will generally ensure that your code runs fast. If you learn nothing else from this list of great advice from Grant, just keep in mind that you should 'write for the optimizer'. More »


From the SQLServerCentral Blogs - PowerShell: Redirecting Console Output and Error Output to a Variable and E-mailing it

I recently had the need to script the execution of a command-line utility and thought it would be a good... More »


Editorial - Watch Your Mouth

I give a talk on branding and resumes that has been well received over the last few years. In it I cover the ways in which you can use networking, blogging, and other ways to improve the chances that employers will want to hire you. There are lots of jobs available, and lots of candidates, but finding a good fit is hard. I would argue that disclosing more about yourself, and your interests, is a good way to help find a good fit with an organization.

One of the cautions I raise in my presentation is that you should be aware of how you present yourself, and the impressions you make. There are no right or wrong ways to do this, but there are ways that reflect differently on you to different people. As such, I do urge you to think about the implications of your actions, your posts, and the way in which you communicate with others. If you are looking for a job, it doesn't make sense to unnecessarily restrict your options because of the things you say or write. 

I ran across this slide show on profanity and cursing at work. I'm not offended by off color language, but some people are, and they often won't let you know that you've created a poor impression. If the data is accurate, the majority of people think regular cursing creates a negative impression. Whether you think it's a lack of control, unprofessional, or anything else, it still is a negative impression. It's also one of the things that caused some HR groups to eliminate candidates.

These days there is competition for jobs, and if you find the job you really like, do you want to diminish your chances because of a few colorful words? You have the freedom in the US to say what you want, and I support that, but you also get the responsibility of handling the consequences. I'd argue a few colorful words aren't worth giving someone a reason to choose another equally qualified candidate over you?

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


The Voice of the DBA Podcasts

We publish three versions of the podcast each day for you to enjoy.

Everyday Jones

The podcast feeds are available at sqlservercentral.mevio.com. Comments are definitely appreciated and wanted, and you can get feeds from there. Overall RSS Feed: or now on iTunes!

Today's podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. Support this great duo at www.everydayjones.com.

You can also follow Steve Jones on Twitter:

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


Question of the Day

Today's Question:

Given the following table definition and statements ((For SQL Server 2008 or later):

CREATE TABLE dbo.Table1 (
    RowID INTEGER IDENTITY PRIMARY KEY CLUSTERED,
    DateTimeStamp DATETIME DEFAULT GETDATE(),
    Col1 INTEGER SPARSE,
    Col2 INTEGER SPARSE,
    Col3 INTEGER SPARSE,
    TblColumnSet XML COLUMN_SET FOR ALL_SPARSE_COLUMNS);

INSERT INTO dbo.Table1 (Col1) VALUES (1), (2);
INSERT INTO dbo.Table1 (Col2) VALUES (3), (4);
INSERT INTO dbo.Table1 (Col3) VALUES (5), (6);
INSERT INTO dbo.Table1 (TblColumnSet) VALUES ('<Col1>1</Col1><Col2>2</Col2><Col3>3</Col3>');

SELECT RowID, DateTimeStamp, Col1, Col2, Col3, TblColumnSet
INTO dbo.Table2
FROM dbo.Table1;

Which properties of the sparse columns (from dbo.Table1) will be transferred to dbo.Table2?

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

This question is worth 1 point in this category: Sparse Columns. We keep track of your score to give you bragging rights against your peers.

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


Yesterday's Question of the Day

What is the output of the following queries (SQL Server 2008 and above):

--Query#1
SET DATEFORMAT mdy; 

DECLARE @dt1 DATE = '01-15-2012'

SELECT ISDATE(@dt1)

--Query#2
SET DATEFORMAT mdy;

DECLARE @dt2 VARCHAR(10) = '01-15-2012'

SELECT ISDATE(@dt2)

Answer: Error,1

Explanation: Query#1 will be errored out as the ISDATE does not accept argument of type DATE. Query#2 will return 1 as expression is a valid date

Ref: ISDATE - http://msdn.microsoft.com/en-us/library/ms187347

» Discuss this question and answer on the forums


Featured Script

How to calculate the check digit for a UCC/EAN code

Function that implements the algorithm for calculating the check digit for a UCC/EAN code More »


Database Pros Who Need Your Help!

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

SQL Server 2005 : Administering

Cretical and important things while designing database - Hello, I need to know the cretical things while designing the database architecture without using it the database system get collaps..? Actually...

sql server CONFIG statement cannot be used inside a user transaction - I got 'CONFIG statement cannot be used inside a user transaction' when running proc 2 below. Any resolution? Thanks. (sql...

xp_delete_file not deleting files on share drive - Hello, xp_delete_file not deleting files on share drive. is there any permission to be given?

Changing FileGroup for File Name - Hi, How can I change a file gorup for a specific file name? The issue that I'm having is that I already...

Have to enter the port to connect via management studio - A strange problem has cropped up in our enviornment that I'm kind of scratching my head about. Why all of...

Linked Server to Oracle - For anyone who can help. I receive the following error when running a query. Msg 7399, Level 16, State 1, Line...

SQL Server 2005 : Backups

backup file size - Can anybody help in this matter Original database size [b]100 MB[/b] Backup files created, in scheduled time but size was [b]357...

SQL Server 2005 : Business Intelligence

ssis flatfile data to database table prob - hi friend i have a small doubt in ssis plz tell me how to solve this prob all columns are separete...

SSIS 2008 - Pivot transformation and DT_NText Datatype - Hi, Has anyone ever tried using a column with dt_ntext datatype in the pivot transformation for ssis 2008? I am trying to...

SSRS default parameter - Hi, I'm trying to develop a new rdl with 2 parameter, both are with drop down values. One parameter is...

High Level Designing - Hi everyone, we have a project and it is going to begin from the scratch, i haven't involved in High...

SQL Server 2005 : SQL Server 2005 General Discussion

Help With Foreign Keys - Hello, I wondered if someone could explain to me how to setup foreign keys that cascade on update for the following...

Is UPDATE FROM only available in SQL 2005? - I rarely have to write an UPDATE query that uses more than 1 table. Today I did, and I came...

SQL Server 2005 : SQL Server 2005 Security

user cannont see tables under database - Hi DBA's Generally i create database level roles and assign them to the logins.. Thi role has select,update,insert permissions I did the same...

SQL Server 2005 : SQL Server 2005 Strategies

How disable DBCC CHEKCDB command - Hi, For error someone run DBCC CHECKDB in production database, now i want disable or cancel this command for prevent this...

SQL Server 2005 : SS2K5 Replication

add article to replication without snapshotting entire DB. - hi I simply want to add an article to an existing publication WITHOUT creating a new snapshot of the entire database,...

SQL Server 2005 : SQL Server Express

Copy rows returned from a RESTORE FILELISTONLY command into a tble - I am trying to copy the rows returned from a RESTORE FILELISTONLY command into a temp table so that I...

SQL Server 2005 : SQL Server 2005 Performance Tuning

What can i do to improve performance on this scenario? - Hello all! We have a Data warehouse that are hosted in a dedicated sql server machine (32Gb memory and 2 processors...

SQL Server 2005 : SQL Server 2005 Integration Services

SSIS package errors and fails in SQL Agent... - Hello - I have an import/export wizard SSIS package that I have saved, and am trying to automate, but it keeps...

pass SSIS Variables to SQL Procedure in SSIS - hi, I have two varibles ..... I want to execute the sp with two variables as parameters... Execute testing.dbo.proc_TEmptest value1,value2 The value1 and value2...

SSIS - dynamic connection - verify data source using script task and email if connection - Hi, I would like to check for the dynamic connection / data sources in the script task and send email if...

SSIS OLE DB Error - I am importing a flat file (.txt) into SQL2005 DB. I seem to betting the following error. I am trying to...

SQL Agent Job running SSIS Package getting "Stuck" - Help!!!! Okay, here is my situation: I have created an SSIS package to run PSCP.exe in order to pull a specific file...

How can use mapping in SSIS using Script in SSIS - This example i have in my DTS package.. Function Main()  DTSDestination("DATA")=YEAR(DATE) & "-" & RIGHT("0" & TRIM(CSTR(MONTH(DATE))), 2) & "-" & RIGHT("0" & TRIM(CSTR(DAY(DATE))), 2)  DTSDestination("BDNCAR") = DTSSource("BDNCAR") &

SQL Server 7,2000 : T-SQL

Make Sequential numbers into ranges - I have a data look like this - Note: have to be breakdown per TNID field TNID TN 3011170 4402787100 3011170 4402787101 3011170 4402787102 3011170 4402787103 3011171 ...

combine two tables - Hi, I have one problem to join two views in one. I have two views which have some fields same and some...

SQL Server 2008 : SQL Server 2008 - General

Memory used by sql server - Good day, We are running SQL server on virtual servers . we capp sql server 's memory to e.g. 6 gig out...

increment values on day basis on column - hi all, i want to generate id column values on the basis of every day. suppose table name like test and table have...

Store procedure help - I want to write a stored procedure where it will take 1 parameter that is DateTime.. but it is showing wrong...

Weird Installation Message - I used to have an HP laptop that had Windows 7 on it. I had very successfully and easily installed...

Weird Requirement... Multiple Left Joins? Am I missing something? - Ok, so I think I should know the answer to this but I'm getting nothing but what looks like a...

SQL Server Replicated DataBase - How do you put a replicated data base in as the primary data base?

SSIS Mapping (Audit) - I have an inquiry based on how SSIS handles mappings for a certain number of columns that increase in time....

MDF File of MS SQL Server 2008 is Corrupted - Last Night I have a problem due to Power failure actually i have used Microsoft SQL Server 2008 everything is...

upgrade from 2005 to 2008 r2 - hi folks, I am looking to upgrade my sql from 2005 to 2008 r2. I understand sql 2008 r2 install needs...

Check room availability in hotel system - [font="Times New Roman"][/font] I'm a university student and I'm developing a database for a hotel system ,now I'm stack when I...

SQL 2008 R2 'wall of weird' submission - I am the developer of our in-house CRM application that runs against a database located on a single SQL 2008...

DBCC TABLE CHECK - I always see there are proceses in SQL about "DBCC TABLE CHECK" 1. I am trying to find out what trigger...

Adventure Works DW 2008R2 - Hi all, I am working through Bill Pearson's tutorial Stairway to MDX - STEP 1: Getting Started with MDX. http://www.sqlservercentral.com/articles/Stairway+Series/71867/ I downloaded and installed...

SQL Server 2008 : T-SQL (SS2K8)

Suppressinig error values - I am using a trigger to check some business logic before doing an insert. If the business logic fails, it...

subdivision on output query in server 2000 - alter procedure Goals_history ( @stuid nvarchar(22), @startyear nvarchar(22), @endyear nvarchar(22), ) as begin select name,class,noofsubject,rank,test from @tab1 union select name,class,subject,rank,test from @tab2 where rank is not null and studentname=@stuid and accodomicyear>=@startyear and...

table sub division on sql server 2000 - table-1 employee details table-2 salary details table-3 incentive details how to make three different tables has to show on single report one by one

Fill the column data with specific row value - I have 2 tables: A and B This is the result obtained: PK CostCenter Amount Assignment Xfd1 50 100210 1250.00 T0250076 100210 50 100210 1250.00 T0250076 100210 40 100250 1250.00 T0250076 100250 40 100370 1250.00 T0250076 100370 Now here is my question: In...

does not work with outer join or outer apply - I am new sql server. I am trying to get the following data. I have 3 different tables table1 table2 table3 table1 id location 1...

find a grouping with at least one row within the group containing a certain value - Hi all, How do you find a group where number of rows in the group are gtr than 1 and at...

##table question? - hello. here is the scenario: sp 1 inserts data in #table, #table is in sp2 and sp3 sp 2 and sp3 are...

help with SQLCMD - Hi , I am trying to use SQLCMD to run a SQL Script. The script is of type. Begin tran Delete ..... Insert ..... Commit...

Getting NULL output against the column : completion_status - --Getting NULL output against the column : completion_status select a.name, case b.type when 'D' then 'Full Database Backup' when 'I' THEN 'Differential...

UPDATE when the values are the same - Does an UPDATE query overwrite existing values if the already existing value is the same as the one your updating...

Best Practice : coalesce vs. isnull? - Just wondering, I like to use ISNULL(column_name, 0) while my friend like to use COALESCE(column_name, 0). We both try using ISNULL...

SQL Server 2008 : Working with Oracle

Oracle Database - Hello all... I am new to database learning. But really got interested in OCA studies. So I have decided to opt that...

Excel Pivot Table shows zeros from a SQL View hitting an Oracle View via a Linked Server - I have a view in Oracle 11G. I want to show the contents in an Excel 2010 Pivot Table without...

SQL Server 2008 : SQL Server Newbies

Split a name on to new columns in a table - Monring, If I have a name all in one cell on a column such as "Mr Simon ASHWORTH" How can I split...

How do I understand 'merge join without sort'? - Execution plan showed me merge join without sort. [img]http://uook.com/full_merge_join_ScanOnly.png[/img] Join was FULL JOIN with no equality in ON clause. I can't understand this. SQL...

Selecting records based on count - I've joined several tables in order to get data I need. However as I look @ data I realized there's a...

Help needed in converting an int datatype to MM/DD/YYYY and converting another int to HH:MM PM - When running the script below I noticed that the two result fields are of datatype int. I would like to convert...

Create view with no outer joins - Need to create view with no outer joins so I can index the view. Here is the query I use...

DBCC SHRINKFILE failing with error Msg 3140, Level 16, State 5, Line 1, Could not adjust the space allocation for file - Hi, I am trying to run SHRINKFILE on one of our data files but it is failing with error [i][b]"Msg 3140,...

SQL query performance question - I am working on a small research team that has been given access to a set of SQL Server 2008...

How to create a policy that will periodically check the membership of sysadmin? - Specifically, I need to know how to set up the condition. In other words, which facet and properties do I...

SQL Server 2008 : Security (SS2K8)

Does SQL 2008 R2 Express support encrypting column / cell data? - I think the subject says it all. I've noticed something with the DB that the developers here are working on...

SQL Server 2008 : SQL Server 2008 High Availability

prerequisite mirroring setup? - Hi, Does SQL Engine service account should be domain account? or can we possible to configure configure local user account? currently...

Question on Multi-Instance Clustering - My shop is about to set up a multi-instance (two node) cluster. I have not yet had the opportunity to...

Log Shipping & DataBase Mirroring - I am New to the Log Shipping & DataBase Mirroring, unfortunately i am asked to perform this by Client :( an any...

VMware or Microsoft Cluster Solution - Very simple question. I used to work for a big, big company. But changed job recently and on my new role,...

Database mirroring login failure - I have configured database mirroring between two servers at a distance 40 miles away from each other. Server specifications: SQL Server...

SQL Server 2008 : SQL Server 2008 Administration

Database backup script - I have been tasked with creating a sql table that contains database backups. The idea is to have all databases listed...

Problem While accessing Network Drive - Trusted Connection - Hello, We have SQL Server 2008 installed on Windows 7 (32 bit). I am trying to execute a stored procedure which...

SQL-Agent Job succeeded - Despite of errors in step1 - I have a SQL-Agent Job which executes a SSIS-Package. There are Errors in the SSIS-Pakage, but the Job is succeeded. Here...

DNS Alias, Clustered instance, Default Port query - Hi all, I am moving databases from a default SQL 2000 instance to a clustered SQL 2008 R2 instance. My aim...

Backup taking MUCH longer on prod HELP:) - I have two environments: DEV: VM 4 virtual cores 16 GB Mydatabase 137242.19 MB Attached SAN storage SQL 2008 R2 standard PROD: Physical 32 Core 2 Processor 64 GB RAM Mydatabase...

Moving tempDB from RAID10 to RAID5 for OLTP? - My data files and tempDB file (single temp file) share the same RAID10 LUN and our SAN controller is saturated/overloaded....

Programming : Powershell

Powershell for network path - I am totally new to powershell(just 2 days) so please bear my ignorance.Here is the code I am trying to...

SQLServerCentral.com : Anything that is NOT about SQL!

Is it OK to ask salary range before applying? - Hi all, I came across a Jr. DBA position with no salary attached. A google search of the company didn't turn...

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

Reporting Services : Reporting Services

Format label percent in Pie chart. - Dear All I have problem with Label on pie chart. My Data 44.21, 37.31, 18.48 if I use pie chart...

Image/Logo Updating - Hi. I would like to know if there is a way to enable to change a logo from a report after...

Data Warehousing : Integration Services

FINDSTRING Function - Hi All, We are using FINDSTRING Function in one of Data flow Derived Column (Component), It work Fine for Symbols like...

Ways to address incremental updates in SSIS - Hi fellows, I'm trying to deploy a datamart, I have the star schema designed and I am working on the ETLs,...

Data Warehousing : Analysis Services

Can I Build a SSAS Cube only by using Dimensions not by measures? - Hi Guys, I just want to know, is it possible in SSAS to bulid a cube based on Dimensions not by...

Data Warehousing : Data Transformation Services (DTS)

Crystal Report run through DTS - Hi, I just run crystal report daily without any parameter and after run, save the file in c:\temp directory. I have...