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

It Happens

Your code is wrong.

Or it's bad, or it won't work as intended. I'm not sure that's the viewpoint I'd like to take when I first start working on a project, but that's what Nathan Marz told the attendees at the NoSQL2013 conference recently. He says that our code should be treated as something that might or might not work, and embrace the idea that the code can be wrong. It's not intended to disparage developers or paint too bleak a picture of our skills be just be realistic in the sense that all projects have problems and software isn't perfectly built at the first compile.

I think most of us do realize that our software also might not work as intended. Even simple projects can have bugs and holes that we'll find when edge cases are introduced or the software is used in a way we didn't expect. At least I hope it's just unanticipated, edge cases and not general cases for most of us. It an application doesn't work for the cases we've designed it for, then we need to work on our coding skills.

We know that building software is hard. We know that outside of a narrow domain in which we've often designed our software, it might not work as intended. Most of us expect to find bugs or problems in our software, and are mentally prepare to patch and enhance our work as needed. It's almost inevitable, and even occurs when you design your own software, to do that one thing you need done. You'll still maintain (meaning patch or enhance) the software over time.

I hope that's not too gloomy a view of software.

Steve Jones from SQLServerCentral.com

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


Video and Audio versions

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.

Follow Steve Jones on Twitter to find links and database related items and announcements.

Steve Jones

Windows Media Video ( 12.6MB) feed

MP4 iPod Video ( 15.0MB) feed

MP3 Audio ( 3.1MB) feed

Feeds are available at iTunes and Mevio

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

ADVERTISEMENT
SQL DBA Bundle

‘10 Tips for Efficient Disaster Recovery’

Steve Jones gives the final lesson in the ‘Top 5 Hard-earned Lessons of a DBA’. Read now and learn from the best.

SQL Compare Pro

Need to compare and sync database schemas?

Let SQL Compare do the hard work. ”With the productivity I'll get out of this tool, it's like buying time.” Robert Sondles. Download a free trial.

sqlinthecity

SQL in the City – Free SQL Server training in the US

Don’t miss out on learning about best practices for SQL Server database development and administration from top SQL Server MVPs. These free seminars and events are coming to San Diego, Denver, Pasadena, Atlanta and Charlotte. Find out more and register.

Featured Contents

 

Stairway to SQL PowerShell Level 2: SQL PowerShell Setup and Config

Ben Miller from SQLServerCentral.com

Now that you know how to get started with PowerShell, it is time to configure PowerShell for SQL Server use. This level covers the components you'll need and how to configure them. More »


 

SSIS 2012 - Introduction to Windows Azure SQL Databases

Additional Articles from Database Journal

When discussing SQL Server 2012 Integration Services, we have been dealing mainly with the traditional data management model, where the entire SQL Server environment resides on-premise. This once predominant paradigm is obviously changing, with hosted solutions (in the form of both private and public clouds) becoming increasingly common. In order to properly account for this trend, we turn our attention to the role that SSIS can serve in a mixed environment, where a part of the SQL Server estate is located in Windows Azure. More »

Question of the Day

Today's Question (by Samith C):

create table #temp_test
 (id int);

insert into #temp_test
 values(1)
insert into #temp_test
 values(2)
insert into #temp_test
 values(3)
insert into #temp_test
 values(5)
go

with ABC_CTE as
 (select * from #temp_test)
delete from ABC_CTE where id = 1;

How many rows in the #temp_test table ?

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


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

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

ADVERTISEMENT

Securing SQL Server

Written by Denny Cherry, a Microsoft MVP for the SQL Server product, a Microsoft Certified Master for SQL Server 2008, and one of the biggest names in SQL Server today, Securing SQL Server, Second Edition explores the potential attack vectors someone can use to break into your SQL Server database as well as how to protect your database from these attacks. In this book, you will learn how to properly secure your database from both internal and external threats using best practices and specific tricks the author uses in his role as an independent consultant while working on some of the largest and most complex SQL Server installations in the world. This edition includes new chapters on Analysis Services, Reporting Services, and Storage Area Network Security.

Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Samith C):

What will be the result of the query?
declare @var Varchar(1000)
set @var = '-- /* select ''Samith'' name 
*/'
set @var = @var + ' select ''sas'''
exec (@var)

Answer: Msg 102, Level 15, State 1, Line 2 Incorrect syntax near '*'.

Explanation: The start comment line[/*] is already commented, so the '*/' is invalid

Ref: /*...*/ (Comment) - http://technet.microsoft.com/en-us/library/ms178623.aspx


» Discuss this question and answer on the forums

Featured Script

Determine if BACKUP COMPRESSION is available

Mark Cook from SQLServerCentral.com

This script can be used to execute your backups if you store your backup scripts on a central location. We do this in order to only maintain one copy of the code. However, we have multiple versions and editions of SQL Server in our environment. I want to use Backup Compression on those servers where it is available. The script will determine if Backup Compression is available and build the BACKUP DATABASE command accordingly. I hope you find it useful.

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

Tempdb data file fills up very often - Tempdb fills up very often. tempdb configuration is name fileid filename filegroup size maxsize growth usage tempdev 1 N:\Data\tempdb.mdf PRIMARY 29428480 KB Unlimited 10% data only templog 2 N:\Data\templog.ldf NULL 512 KB Unlimited 10% log only I want to know why its happening very often...


SQL Server 2012 : SQL 2012 - General

Weird slowdown issue, possible table lock - Can anyone help me understand what is happening here? I have a tall table containing a list of IDs and...

temp table vs permanent table performance - Hi There , Im handling cores of data which will refreshed in every run. for this which one I can go with...

Doubts with Log Shipping - When logshipping is configured, we know that along with LS Backup/copy and restore jobs, LS ALert jobs are also created,...

activity monitor in SSMS Unable to access -- error. - I receive the following messages when trying to use activity monitor in SSMS Error: The activity monitor is unable to execute...

crazy replication question - I have replication running with a 2 publications coming out of the same database. Publication number 1 has all but...

sql server 2012 licensing question - Hello all We have a fairly simple SQL server environment today (licensing wise) All of our SQL Server instances are...

SSRS report with dynamic column headers - Hi, I have a report which runs for last 12 months data. Since this is going to be last 12 months...

screenshot on view - I had a table like this: [code="other"]Name StartTime EndTime -------------------------------- abc 10:00 14:00 bcd 10:05 12:32 cde 13:10 14:08 dfe 11:00 11:08 [/code] We planning to create the...


SQL Server 2012 : SQL Server 2012 - T-SQL

Help with SQL Maths Operators - Hello I have a calculation in a Access Database that I am trying to change into a SQL Server query; however,...

Deletes takes a long time, but CPU, Disk and RAM untroubled...why ? - Hi all, Running SQL 2012 BI on a spanky new server with 2690 x 2 CPU, fast SSD, ramdisk for tempdb...

Doubt on trigger - Hello Everybody, I have a table and sp . I want no one to drop those. Am I able to set...

Reg : Help on Transactions in SQL - Hi There, I have some doubts on transactions. Following is my problem & I'm intended to go with transactions . I have a...

Converting Access Function in SQL Function, Help - hello I'm trying to convert an Access function into a SQL function and having a litlte problem with the syntax. Hopefully...

Trying to build a report menu from data stored in two tables in SQL Database - I have two separate tables in my database ReportCategories and Reports. I am trying to determine how I can pull...

108,000,000 row table - check for matches - Good afternoon, Long time reader - first time poster here! I am currently working on a 108m row table where some of...

Trigger Issue... - Hi, I've a table that has a trigger for insert that executes the flowing statement: [code="sql"] UPDATE ArtigoArmazem SET QtReservada = 0 FROM INSERTED...


SQL Server 2008 : SQL Server 2008 - General

Urgent Help Guys for this Scenario!!! - Hi, I have a table say emp which has two columns empid and empskills.I need a query to retrieve the...

select query not working - Here is my table script: USE [MyDB] GO /****** Object: Table [dbo].[USER_MAC_MAPPING] Script Date: 09/24/2013 18:34:41 ******/ IF EXISTS (SELECT * FROM sys.objects WHERE object_id...

Query Execution Slow and Fast find the difference - Hi, I'm desesperated and I need some help. I've a problem with a simple query. If I put a where clause...

SQL 2008 Developer Edition - Help! I need to obtain a copy of SQL 2008 Dev edition, but Amazon and Microsoft and Provantage don't have...

Security restriction to a SP - I have a little application which allows a user to execute a store procedure with a database restore command in...

Problem to create a view with SHEMABINDING OPTION - Hello, I met a problem when I tried to create a view with option SCHEMABINDING. I need to do that because...

Hierarchical Data Type vs Parent-Child - Hi, Could someone please tell me when to (not)use what? From what I read it seems that using Hierarchical type is...

Tracking database changes - Hey all, I am in need of obtaining software or a process to automatically find DDL changes to my enterprise environment...

Invalid object name ??! - Run: use xxxx go select * from [xxxx].[xxxxxx] Got: Msg 208, Level 16, State 1, Line 1 Invalid object name 'xxxxxx'. i double checked: 1) run it under right...

TSQL/SSRS: How to add "dynamics" without dynamic SQL - Hi, I'm facing a task how to deal with unknown number of user entered params, could be from 1 to 10. User...

adding another target server to a designated MSX - Hi We have a MSX server with a number of target servers already added. I am trying to add a new...

subtract from two tables - hi everyone, Hope you are good. Need some little help. I am developing some inventory app and now need some help...

Symptoms Memory Problems - what are the symptoms of Memory Problems in sql server

Rolling 3 month average cost help - Hi guys, I need some help calculating a 3 month avergae rolling cost. I have been trying to figure this out...

SSMS closes without warning during query run - Does anyone know why SSMS would close without warning during the middle of a query run? It's done this to me...

Backup SQL agent Job - Can I setup a single agent job to handle Full(Every Sunday at 00:00), Differential(Everyday at 00:00) and log backups(every 30...

Script to find all filestream databases with list of Tables (contain filestream column) - Hello, Do you have a script to find all filestream databases with list of tables containing Filestream Column ? I would like...

Execution Plans Question - I'm playing with a stored proc that takes 2 days to run. I am pretty certain the issue was the...

Max Memory - I have set Max Memory to 6 GB. But SQL Server is using only 2.9 GB Query used: SELECT object_name, counter_name, cntr_value...

SQL Server 2008 cluster node going down unexpectedly - Last night our primary SQL Server node went down and failed over to the secondary node. I was actually on the...

Need to fill the Gaps with previous value - Hi experts, I have a scenario to fill in the GAPS between the dates with previousdate+1 day. here is the table DDL...


SQL Server 2008 : T-SQL (SS2K8)

Seeking Explanation for Query Performance difference... - Just after some advice if possible. I had a Stored Procedure which had a join to a Scalar Valued Function, returning...

inconsistently wrong query results - Hi All - I have a count/grouping problem and for the life of me can't make sense of it. Involved in...

Query - Dear All I have one scnario. One column i am having Following records 1a 2a 2b ... . . . . 10a 10b But i want following output through Query 1 2 2 . . . . 10 10 .

Query performance - Hi, I have a query which takes more than 2 min whenver it runs. Is there any other way to wrtie this...

Phone number question - detecting and replacing - Hello, I have a website/database app with a text column that stores a user's bio where users are not allowed to...

job history check - Hi friends, I have around 120 jobs in a SQL instance. Some of the jobs are scheduled on hourly basis and...

Rapid Growth Of Data and Purging Issues - Hi, I tried a few different things which though work well but needs atleast few minutes of downtime so I am...

Better way to write this query - I have inherited this query that is comparing data from one table to another. It is using a combination of...

Advice on complex logic with embedded functions. - Hi, I have a scenario were under certain circumstances I need to use the earliest start date and then the latest...


SQL Server 2008 : SQL Server Newbies

sql server 2008 r2 installation error - hi while installing sql server 2008 r2 at the end its giving error service 'sql browser' start error and installation failing. please...

Creating a new column and inserting data on it from an existing column - Is there any way we can create a new column based on the results of a select. i am trying...

Display the results of search in a DataGridView - Hi to all especially to those who always answer my questions wholeheartedly :-) I Have another question..and this is my Code..... ============================================================ set...

domain\server$ - Hi, SQL Server log shows several login failures from the login "domain\server$". What does that mean? I read somewhere that...

Search Using Stored Procedure - Hi to all :-) I want to have a result like this ---- SELECT * FROM TestMyView WHERE firstname = 'test5' but my code will...


SQL Server 2008 : Security (SS2K8)

SSRS Column Hide based on User Login. - HI, I need to create a report in which I need to hide the column data base on who userid. for...


SQL Server 2008 : SQL Server 2008 High Availability

Database mirroring High Safety (synchronous) with Autofailover - witness availability.. - Hi, Hope i can get some feedback regarding a scenario we have in an environment that has been designed to use...

Experiment in High Availability - Hi All, Would like to get some hands-on with the high availability options (Log-shipping, Replication, Database-Mirroring and Server Clustering). Can I do...

MS clustering without WFCS - Any one aware or used this tool DXconsole for setting MS Clustering on VMs or physical box. This is a...


SQL Server 2008 : SQL Server 2008 Administration

Application stopped during Rebuild Index? - Hi, Version - SQL Server 2008 R2 64 bit. I created Maintenance plan for Re-organize and Rebuild index in single jobs.. Jobs successfully...

Replication Databses are not Showing - Hi, I have some replication databases on some servers and those replicated databases are not showing in my table, i don't...

Which system tables save permissions and SQL server configuration - I need to add rights and permissions data to SQL source control. Which system tables from master/model/msdb do I need...

Log Shipping Revertion - Hi, This is Damodar. My question is on Log Shipping, I have to reverse the log shipping from DR to...

Connection to SQL Server with Access data project failed - Hi, We want to connect an Access adp (Office 2010) from a client computer (Windows 7 32 bit) to a...

SQL Server backup Failures with TSM \TDP TCP\IP Connection Failure - Sql Server Versions 2005, 2008R2 Folks I'm at a loss and the TSM Administrators are also now throwing lines into the...

MAXDOP question - The computer that i run queries on has 2 processors. Shouldn't query1 execute faster than query2 ? Surprisingly, both executed taking...


SQL Server 2008 : SQL Server 2008 Performance Tuning

Tuning Advisor - Dear Experts: I am new in using tuning advisor. I have created tuning trace file, after finishing, there were some recommendations...

cxpacket wait differences for same query on different cluster nodes - Hey guys, We are running a 5 node windows server cluster with multiple SQL 2008 instances. 1 instance in particular, our...

How to go and troubleshoot Internal memory pressure - Hi All, Can anyone share links/examples on how to identify and troubleshoot sql server internal memory pressure from SQL Server 2005...

Paritioning key column as an included column or trailing index column - We know that, SQL Server automatically adds the partition column to a secondary nonunique index as an included column if the...


SQL Server 2005 : Administering

Installation disc for MS SQL 2008 R2 DE from a downloaded ISO file - How do I create an installation disc for MS SQL 2008 R2 DE from a downloaded ISO file?

Set up jobs on SQL Server 2012 Servers in AlwaysOn configuration - Hello everybody, I am a SQL DBA and need some help. We currently have two 2012 SQL Servers in High Availability. I scripted...


SQL Server 2005 : Backups

litespeed backup consumes high cpu - is litespeed one of the causes of high cpu??


SQL Server 2005 : Business Intelligence

read file in email - Hello, Is there a way in ssis to read outlook and pickup a file from the email and then process that...


SQL Server 2005 : Development

A severe error occurred on the current command - When iam Running the Stored procedure there is an error occuring "A severe error occurred on the current command" this is my...


SQL Server 2005 : SQL Server 2005 General Discussion

Database backup - hello, i want to take a sql server 2005 database backup on task schedule every 1 hour is that possible. please help...

Unable to send mail using database mail - Hi at one of client side i am not able to send mail i am getting following error The mail could...

Can you please anybody one explain? - How to do database migration in Sql server? i need basic and step by step instruction..... Please help me Thanks in advance

How to Write Query for the Below Requirement? - Hi everyone Can Any Body Help me how to write Query for the below requirement. I have Table in my Attachment I want...

add a bar code font in a report to avoid installing it on every client ? - Hello, I'm in SSRS 2005 and I would like if someone had an idea to add a font (barcode) in a...

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

OLE DB provider "SQLNCLI" for linked server " " returned message "No transaction is active." - I have linked a local SQL 2005 Standard Server 32-bit Unclustered to a remote SQL Server 2005 Standard 64-bit Clustered...


SQL Server 2005 : SQL Server 2005 Performance Tuning

max server memory configuration - hello all, please find below configuration windows server 2003 enterprise edition 64 bit sql server 2005 enterprise edition 64 bit Total RAM= 127 GB my...


SQL Server 2005 : SQL Server 2005 Integration Services

SSIS, Excel, and DT_NTEXT - OK, I have fought this problem for the last three days. I now bow to the extensive and superior knoweledge...


SQL Server 2005 : SQL Server Newbies

Return value if field not there in Query - I want to check field/column exist or not in a table and populate the value Example: Does the column1,column2 exists: case1:return column1...

using ISNULL and SUM on the same column - I want to generate a report to compare the estimated_total_fee (on the usr_int1 table) with the amount the customer has...


Reporting Services : Reporting Services

REPORTING SERVICES. - can anybody please giude me how to start reporting services(SSRS) from command prompt,as i googled it but in vain.please give...

SSRS 2008 Tool Tip Issue - i have a report. which has images embedded in it. (like red for value 1, yellow for 2 and 3...

reporting services - can anybody please giude me how to start reporting services(SSRS) from command prompt,as i googled it but in vain.please give...

SQL Book Questions - Couple of SQL realted Book Questions I am seeking a book on SSRS 2012 and am considering the recently published title...

ABOUT REPORT IN REPORT BUILDER - HOW TO GET parameter value as null when we keep as null and show the text what we enter in...

Postnet Barcode In Rdlc - how to generate Postnet Barcode in RDLC Webform based on Zipcode


Reporting Services : Reporting Services 2005 Development

connection to the cube in reporting server - I have a reports that is using cube and it works fine in SSRS but when i deploy it to...


Reporting Services : Reporting Services 2008 Development

Is it possible in SSRS? - I would like to create a drill through action that calls a report (passes parameters ) and the detailed report has...


Data Warehousing : Integration Services

Does anyone have a book recommendation for building packages with SQL Server 2012 - From what I've read I only need a standard server license to run SSIS jobs I am looking for a...

Configuration settings for SQL Server 2012? Is the major consensus to stay with file based dtsconfig or move to SQLServer Table based configs - My boss likes using the XML file based configs and passing the file in as a parameter for a DTEX...


Data Warehousing : Strategies and Ideas

Display all facts using latest set of dimension keys? - I have a requirement where I need to provide two views of the same facts across several dimensions. The first view...


Data Warehousing : Analysis Services

Update Dimension Member - I've been tasked with populating the description of all dimensions and measures in our analysis services cubes to then be...


SQLServerCentral.com : Anything that is NOT about SQL!

When Curiosity strikes - Hi Everyone.. What is the meaning of SSC Rockie, SSC Veteran, SSC Champion.... etc...?? I'm a New ACTIVE member to this group.. hehe Cheers...

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 : Articles Requested

Fixing duplicates - An article that looks at the problem of getting duplicate data, for example, invoices. Imagine I have a software bug...


SQL Server 7,2000 : Administration

application issue with these SQL errors - Following error messages are logged in SQL Server 2000 instance. Database model: IO is thawed Database master: IO is frozen for snapshot The...


SQL Server 7,2000 : T-SQL

Case Statement to return multiple columns - Hi all am trying to write a case statement an that currently returns one column. Is there any way that it...

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 ©2013 Red Gate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com