SQLServerCentral - www.sqlservercentral.com

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

ADVERTISEMENT
SQL Source Control

Get your SQL Server database under version control now!

Version control is standard for applications, but databases haven’t caught up. So how can you bring database development up to speed? Why should you start? Find out…

SQL Monitor

Getting started with SQL Server?

First things first, begin monitoring your servers to plot baselines and initiate a health check. With baselines in hand, you can find irregularities in performance. SQL Monitor can help, try it free.

Database Performance Tips for Developers

FREE eBook "45 Database Performance Tips for Developers"

Improve your database performance with 45 tips from SQL Server MVPs and industry experts. Get the free eBook here.

Featured Contents

Featured Script

The Voice of the DBA

All the People Smarter than Me - Editorial

I was an Accidental DBA at the start, intentional DBA now and forever, and I have to say that the SQL Server community is like none other. The day after I started my job as a Java developer in 2003, the DBA put in her 2 week notice. My boss took a big risk when he asked me “want to be a DBA?”, and that changed everything. I did both for quite some time and eventually transitioned into straight-up full time DBA. My first boss was excellent. He told me about SQLServerCentral, and I was hooked. Daily questions, forums for help, and just a wealth of great articles gave me a great kick start on becoming a halfway decent DBA. 

PASS, what is this thing?  Users groups?  Seriously you must be joking.  Fortunately I live close enough to a city that had a great users group. Attending a few of these monthly meetings introduced me to great speakers like Randy Dyess and Brent Ozar. About five years ago a local team put together this new thing called “SQL Saturday” that was free for anyone that wanted to come. I was sure I hit the jackpot. Brent Ozar introduced a great new tool he had created called “sp_blitz”. I was in awe. Shortly after this came Triage Tuesdays, a free weekly ½ hour training event from Brent Ozar Unlimited Red Gate did a free event, SQL in the City, where I got to meet some heroes like Steve Jones, Allen White and Grant Fritchey. Granted I didn’t ever talk to them personally, but hearing them speak so passionately about SQL Server was good enough for me. Over the years I have signed up for every newsletter possible, SQLServerCentral, SQL Skills, and the Brent Ozar Unlimited Weekly Links. There are so many opportunities for training you could probably watch a free webinar every day.  

I just recently attended a SQL Saturday and learned a bunch of cool new things that I can’t wait to implement. I sat in on a few “packed house” sessions with icons like Brent Ozar and Adam Mechanic. While eavesdropping on passing conversations, I was shocked to hear people say, “Oh, I haven’t heard of him before”. I thought to myself, where do you live under a rock?  There were even people talking about flying in for this event. 

Now is the time to invest in you. I guess I just consider myself lucky to have had a great boss that pushed training into our laps. He always said you should be spending at least a couple of hours a week reading articles, learning something new.  His philosophy was that if you learn something new it will help the company, maybe not today, but eventually. Just this week, I used something that I learned from this last SQL Saturday to fix a critical production performance issue. Thank you “Clash of the Row Goals” session.

Most of my career I have been the lone DBA in the company. Without all these people I might still be using maintenance plans for index maintenance, shrinking transaction logs, using select distinct just in case, or who knows what other things I am sure I did on day one. Maybe someday I will have icon status, but until then I owe a great thanks to all the mentors, MVPs, SQL bloggers, and other contributors to the SQL community. There are too many names out there to call them all out individually. I am so glad that there are people out there smarter than me that take the time to put information out there for me to read, watch and implement. Because of you most anyone can be a successful accidental turned intentional DBA.

Thank you!

Sarah Wagner from SQLServerCentral.com

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

Featured Contents

 

Database Permissions

C.J. Garcia from SQLServerCentral.com

Here is a short How To article on querying for permissions in a SQL Server database More »


 

Kill SPID (SQL Spackle)

Kenneth Fisher from SQLServerCentral.com

How to find and kill a runaway or blocking session. More »


 

Finding SQL Server objects that reference invalid objects

Additional Articles from MSSQLTips.com

Since many environments haven't committed to using a source control system, identifying mismatched objects can offer a challenge. Tim Smith offers a solution. More »

Question of the Day

Today's Question (by Andy Warren):

Using SQL Server 2012, which of the following activities will use a table created with an integer identity column with a seed of -2147483648?

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

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

Introducing SQL Server 2014

Get a head start evaluating SQL Server 2014 - guided by two experts who have worked with the technology from the earliest beta. Based on Community Technology Preview 2 (CTP2) software, this guide introduces new features and capabilities, with practical insights on how SQL Server 2014 can meet the needs of your business. Get the early, high-level overview you need to begin preparing your deployment now.

Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Mike Bova):

CREATE TABLE #Data
(
  CurrencyId INT
, GLAccountId INT
, ItemAmt DECIMAL(7,2)
)

INSERT INTO #Data
VALUES(1,1,52.50)

INSERT INTO #Data
VALUES(1,1,3.00)

INSERT INTO #Data
VALUES(2,2,27.30)

INSERT INTO #Data
VALUES(2,3,59.80)

DECLARE @CurrencyId  INT
DECLARE @GLAccountId INT
DECLARE @ItemAmt     DECIMAL

SET @CurrencyId = 0
SET @GLAccountId = 0 
SET @ItemAMt = 0


SELECT 
  CurrencyId 
, GLAccountId
, ItemAmt
FROM #Data
WHERE 
CurrencyId = ISNULL(NULLIF(@CurrencyId,0), CurrencyId)
AND GLAccountId = ISNULL(NULLIF(@GLAccountId,0), GLAccountId)
AND ItemAmt = ISNULL(NULLIF(@ItemAmt,0), ItemAmt)
How many records are returned?

Answer: 1

Explanation:

1

CurrencyId GLAccountId ItemAmt
1          1           3.00

Since the Variable @ItemAmt is defined as Decimal, the default is decimal(18,0).  Since @ItemAmt is also the first variable in the NullIf and the ISNull the second parameter ItemAmt gets converted implicily to decimal(18,0), even if NULL is returned for the first.  So the query only returns those records in whole numbers.


» Discuss this question and answer on the forums

Featured Script

Query to find all sessions in each group

Patrick Akhamie from SQLServerCentral.com

Just Copy, Paste and Run. The code requires the resource governor to be enabled on the server for it to work properly.

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

Upgrade client tools from 2008 to 2014 - We are upgrading from SQL Server 2008 to 2014. Do we need to upgrade anything on clients that are connecting...

Rebuild Indexes after upgrade to 2014? - We are doing a side by side upgrade from SQL Server 2008 to 2014 by setting up log shipping to...

How to repair backup of .mdf file database? - Hi folks, One of our clients gets the following error when trying to backup a database: quote: ________________________________________ System.Data.SqlClient.SqlException: SQL Server detected a logical...

Are DMVs deprecated in 2014 SQL Instance - I'm SysAdmin on a SQL Instance which is 2014 version. I'm not able to get the results for my DMVs. I'm...

Having problems upgrading to SQL 2014 - I've got SQL Server 2008 R2 Developer Edition on my desktop. I'm trying to upgrade it to SQL Server 2014...

SQL Server 2014 - Service Pack 1? - Hi there I am planning to migrate from SQL2008R2 --> SQL2014 but my team mates have concerns about migration of MS...


SQL Server 2012 : SQL 2012 - General

SSIS 2012 Attunity Oracle connector problem - I am trying to deploy my SSIS package from my Windows 7 64-bit development machine to a Windows Server 2008...

Using a Stored Procedure to truncate tables? - I was just looking at an SSIS package someone else set up and I went into one of the execute...

SQL 2012 Memory Leak? - We have a SQL 2012 SP1 running 64bit in Window 2008. We are reviewing a possible memory leak in the...

Database can't be in two Availablity Groups - I been trying to learn availability groups since I have not implemented it. From my understanding you can have more than...

Index rebuild maintenance plan - Hi, when we execute maintenance plan for index rebuild, does SQL server rebuild indexes in any order.? is it select the...

DID NOT have to re-establish the login and db user link after restoring database - We have SQL Server 2012 running on Windows 2008 Server. We copied databases from one server to another server using...

SSAS Upgrade from 2005-2012 - Hello all, Quick question... I am in the process of moving my 2005 SSAS cubes to 2012. From what I understand,...

Computed Column for frequent filters - First, background on our environment - we have a handful of developers and each of us are responsible for laying out...

snapshot isolation - Hello. Is a good idea to use this behavior in a busy OLTP? What is the best for that case, snapshot or...

Restoring Issue in 2012.. - Dear All, Am using 2008 and 2012 in my System. I have Question like the following. In 2008 i have taken the Full...

SQL Server 2012 Training and Certification - Get Microsoft MCSA SQL Server 2012 Bootcamp Training and Certifications Now! Mercury Solutions Limited covers all aspects of Microsoft's premier...

SQL 2012 Master database - Hi Experts, What exactly is a core differences between master database in SQL 2012 cluster instance and SQL 2012 standalone instance.Is...

Possible to utilize something similar to a linked server login on the same server? - We have a database that houses student data for 20+ school districts. The designers opted to put all of the...

Instance login failure - Hi, i have created a new instance in with mixed mode authentication. while i am connecting to SSMS with new...

Problems with Policy Based Management using the Login facet - I am using PBM to check if our 'sa' account on numerous servers is disabled and renamed. Obviously I do not...

SQL Server installation - I have been tasked to install SQL Server 2012 Enterprise and Business Intelligence version of sql servers in a windows...

UpGrading from SQL 2005 to 2012 - Hi Guys, I have to upgrade my SQL Server from 2015 to 2012. the problem with me is the OS (Windows...


SQL Server 2012 : SQL Server 2012 - T-SQL

Query Runs on Production and Not on Development SQL Server - I have two servers: one production and one development. There is a third party query that runs on both servers....

Return Count - Hi all, I have a scenario in which I need to capture count of rows returned by execution of stored procedure. I...

Stored Procedure Performance - I was wondering if anyone knows of a way to speed this stored procedure up some, there are no pk...

help with Paid in Full updates to transaction table - Hi I've been trying to solve this for hours and clearly could do with some help! I am basically trying to...

check that column has one and only one value and the value is the value I want - Is there an elegant way to solve the question "I only want to show widgets that have a value "Y"...


SQL Server 2008 : SQL Server 2008 - General

BCP - I have huge table around 5 million rows in source table (i.e Sybase server) .Need to copy 5 million rows...

Bulk insert statement cannto open file on the share - I am trying to execute a bulk insert statement in SQL management studio. BULK INSERT PSStudentAccess FROM '\\servername\pj_sharepoint\external\autosend\myfile.txt" WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '' ) Cannot bulk load because...

urgent SQL query to delete table data and shrink after - DBAs, urgent help please . 1.what is the query , sql command to delete all table data in a database in SQL...

Extract only numbers from a string - Hi, I have no the following. can someone help me tweak it so the i get both sets of numbers...

Where Clause error? - Hello, I am making a query that allows the user input a Begin Date and an End Date while choosing...

rewrite join - Can we rewrite the outer query mention below particularly NOT IN statement of the outer query SELECT DISTINCT A.sno , pm.ProductID , A.ProductName...

Mainstream Support Ending - Important or Not Really? - Just curious as to what the general feeling is amongst the community whether SQL 2008 R2 reaching the end of...

Save DeadLock XML events Seperately - Hi Team, Create a server side trace to capture locks. How to indlude/Create "Save DeadLock XML events Seperately" physical file using server...

Query issues? - I am wondering if I can get some help from the community. I have this query which is taking up...

T SQL Query to find the running commands - Hi, Can anyone please reply with a good T SQL statement which can fetch the running commands also? I mean get the...

Need help on SQL Query - your urgent help is highly appreciated as this is a high priority task. Here is a little background information: One item may...

RESTORE DB FROM 2008 to 2012 - Hello everybody. I am going to restore my master, model, msdb, and tempdb from my previous MS sql server 2008...

Clustering for SSIS (SQL 2008 R2) - Hi All, I am aware that Microsoft has said that SSIS isn't a cluster aware service. However, is there a way...

Running total error - Hi, I am trying to calculate running total in sql as its not giving me the desired result on SSRS (on...

Creating Lat Lon Grid table from list of - Hi, I am trying to build a report that shows 250metre radius plast zones at 25metre intervals over an area in...

concatenate rows using for xml path and new line feed carriage - Good day Guys i have this code -------- Create TABLE #tempCityState (State Varchar(5), City Varchar(50)) Insert Into #tempCityState Select 'CO', 'Denver' Union Select 'CO', 'Teluride' Union Select...

Issue with 12/30/1899 in flat file import in SSIS .. - Hi Friends, I have a package which imports customer information into a table from flat file. The file has a birth date...

Hierarchy Structure SQL Query - I have a tree structure is like this - Apartment -Building 1508 - Room 210 - Room 211 - Building 1509 - Building 1510 I...


SQL Server 2008 : T-SQL (SS2K8)

Search based on a table name and add code to the existing Stored Procedures - Below is sample SQL: SQL_1: Creates a database SQL_2: Creates 2 stored procedures Now, I need to search database SP`s for [code="sql"]Table2...

APR Calculation NEEDED. - I was hoping someone could help me with doing an APR calculation in SQL. I have Loan Amount, # of months(term),...

Query help- Need to create dummy rows - Hi All, I have a requirement that I need help with, I am getting the table Mytemp populated from SRC tables...

show changes from and changes to in a history table - hi! I have a table history of Employee data. id | EmpNo | EmpName | MobileNo | Email | EmpSSS | UpdateDate | UpdateUser I have to make a...

Find the Tables that are generated from a SSIS package - Hi, I have three databases and 40 tables within each database on my server, for each of the tables I want...

Is the comparison of HashPasswords happens at the client level or db level? - This is to follow up this [url=http://www.sqlservercentral.com/Forums/Topic1582709-392-1.aspx]thread [/url]on writing a user authentication script for a client application. I thought to...


SQL Server 2008 : SQL Server Newbies

retrieving 1 record takes 5 times longer than before PC went into sleep and woke up - I have a chart which updates every 5 seconds it takes 5 ms to update the chart and 5ms to...

Microsoft Query - I know this is the wrong forum to post but I have no idea where to post and this is...

FULL --> SIMPLE --> FULL Recovery Model - SQL 2008 R2 Standard - Hello, We have a requirement to rebuild a load of very heavily fragmented indexes. We do not have Enterprise so has...


SQL Server 2008 : Security (SS2K8)

Windows administrator privileges on your own workstation-new management policy - Because I'm in a small company I am doing .NET and SQL development as well as database administration. It took...

Restrict access to database - Hello, as I have said before, I am not good at security setting. I created a new database "Finance" Currently the...


SQL Server 2008 : SQL Server 2008 Administration

And then today this happened... - If only someone would write a book or article on a searchable, networked platform about this sort of thing. [img]http://i.imgur.com/9TRpXDx.png[/img]

Query to check for current database backup? - I have a script that: - Takes a transaction log backup of my database; - Checks for transaction log size significantly larger...

Can frequent shrink files cause DB corruption - Hi Experts, Will shrink files on database files cause corruption by any chance?? TIA

index rebuild performance/server performance - Trying to migrated to new server with client. Seeing peformance issues from the applicaiton end, going from sql 2005 12...

Task manager of SQL box shows 100% memory usage but it is not actually used.. - Hi My SQL box has 34 GB RAM and SQL instance is set to use max memory of 26GB, leaving 8...

SQL Server 2008 R2: SSRS Service won't start. - I just fixed a problem, and i'd like to share what I found. The error message/syptoms are very similar to...


SQL Server 2008 : Data Corruption (SS2K8 / SS2K8 R2)

SQL Server detected a logical consistency-based I/O error - Hi, Two months back Installed SQL server 2008 enterprise edition in PC based server.. Now database running with consistency error.. Could...


Cloud Computing : SQL Azure - Development

SQL Server in the cloud - data seems . . . inaccessible - Hi. I'm having my first foray into SQL Server in the cloud and I'm not having any fun at all....


Cloud Computing : General Cloud Computing Questions

Consideration for Azure for Bisness intelligence - Im just started a new position as BI developer and planning out my strategie for implementing a BI solution. This...


SQL Server 2005 : Administering

Script to delete orphaned users - Hi, I have deleted some logins from my SQL Server 2005 servers, now i need a script to delete the...


SQL Server 2005 : Backups

Database backups best practice - We are planning to implement the following backup plan, please let me know your ideas: 1. Full database backup - weekly once...


SQL Server 2005 : Business Intelligence

Is it possible to set the datasource for multiple reports in Report Manager to the same datasource all at the same time without having to perform the steps for each report? - Is it possible to set the datasource for multiple reports in Report Manager to the same datasource all at the...


SQL Server 2005 : Development

User Defined Data Types versus User Defined Types - In SS Mgmt Studio under Database>Programmability>Types... there are two User-defined type options: Data types and Types. Everything I found by...


SQL Server 2005 : SQL Server 2005 General Discussion

Common Script for Insert - Dear All, How to write a script for "Common Script for Insert Statement" in SQL Server 2005?

For varchar(max) should i use normarl update or .write in following situation - Hi, I want to update a col , which is null initially. and i have to run UPDATE STMT at many places becuase...


SQL Server 2005 : SQL Server 2005 Integration Services

SSIS not importing all of Excel file - I've got an Excel source and OleDB Destination set up. The SSIS package runs, but I only get 23591 records, out...

SSIS Web Services Task question - I am new to SSIS and trying to add a variable to the Web Service Task Input section. In the...


SQL Server 2005 : T-SQL (SS2K5)

DELETE + EXCEPT/INTERSECT + NULLS + BITS! - Okay, this one's got me stumped! I want to compare the values of a Scratch table against those of a...

CONVERT COLUMN VALUES TO COMMA SEPARATED ONE ROW VALUE.. - hi all... I have a query the returns country....state...and cities the cities are creating ore rows than required, I need to...


SQL Server 2005 : SQL Server Newbies

Modify Package Issue - I'm trying to modify a daily backup package I built awhile back, but when I right-click on it and click...


Reporting Services : Reporting Services

ssrs parameter value use can select from - In an new SSRS 2008 the endyear parameter has, 1. the following is the default values sql: Select case when MONTH (GETDATE())...

Broken sort order sp vs. RDL, is it a bug??? SOS - Hi, I'm on SQLServer 2012 with most recent pack. I have a report running on sp, and I'm getting this results...

ssrs export to different tabs in excel - In a new SSRS 2008 report, I have 5 different datasets that are running on the 'Main' report. I am...

Adding Custom DLL to SSRS 2008 - I am trying to create SSRS 2008 reports using Visual Studio 2010.When referencing a custom DLL , I encountered the following...

[rsErrorReadingDataSetField] The dataset contains a definition for the Field. The data extension returned an error during reading the field. There is no data for the field at position 1 - Hi, I am trying to create a report which takes the instance_name and Database_name as input parameters and displays the...


Reporting Services : Reporting Services 2008 Development

Null Date Parameter, IIf condition generates runtime error. - I have a date parameter that is allowed to be null. If the user unchecks the Null box and supplies...

Page break in Column Groups - [font="Comic Sans MS"]Hi all , I was trying to create a column group and insert a Page break after each column...


Reporting Services : SSRS 2012

Summing entire report with different criteria for different locations - Hello All, I am trying to get a percentage of "On Time" shipments for all locations for one week periods. My company...

Issue with DATEDIFF "w" - Hello All, I have looked on a few dozen web pages and cannot find the answer to this one. Here is what...


Programming : XML

Need help to process recursive XML, please - I need a help / advice to process recursive XML, please: I have a given XML which structure I cannot modify. I...


Data Warehousing : Integration Services

Need expression of file name attachment to include the Month in the Year in a specific format. - I need expression of file name attachment to include the Month in the Year in a specific format. This is the...

I need Simple mailing using Script task in SSIS 2008 R2 - Hi Friends, I am working in a package where i need to send a mail to users. I am getting the...


Data Warehousing : Strategies and Ideas

Data Dictionary Table in Staging Database - We are trying to extract flat files into a staging database. The extracted data from the flat files should be...

EFFICIENT Front End for SQL Server - I know there's been many questions about SQL front ends, but I have some specific requirements I haven't seen addressed. I'm...

Should my dimension table be this big? - Im in the process of building my first product dimension for a star schema and not sure if im doing...


SQLServerCentral.com : Anything that is NOT about SQL!

Suggestions for new SQL book. - I have finished these cover to cover and now need new reading material. Any suggestions? Any good SSRS books out...

Job wasn't as described - Need some advice. The job description was for a senior level dba which I am. But when I showed up all...

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


SQL Server 7,2000 : Administration

SQL Traces - I have discovered some traces that are consuming space on an old server running sql server 2000. I found them by...


SQL Server 7,2000 : T-SQL

CONVERTING PLSQL TO TSQL - converT this PLSQL TO TSQL help CUSTOMER# - DECODE(Transaction Type Code,'FULL RETIREMENT',3,'PARTIAL RETIREMENT',DECODE(SAME_YEAR,'Y',3),'ADDITION',DECODE(SAME_YEAR,'Y',( DECODE(TO_NUMBER(SUBSTR(Date Entered,-2))-( TO_NUMBER(SUBSTR(Date Placed In Service,-2)) ),0,1,4) )),'ADJUSTMENT',DECODE(SAME_YEAR,'Y',( DECODE(( TO_NUMBER(SUBSTR(Date...


Career : Employers and Employees

How do you describe what you do? - You're at the dinner table with your in-laws, and the conversation turns to what exactly it [i]is[/i] that you do...

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