A community of more than 1,600,000 database professionals and growing
The Voice of the DBA
Independence Day 2013
It's the Fourth of July, Independence Day, in the United States. This is a holiday commemorating the anniversary of the adoption of the Declaration of Independence signing, which was the beginning of the United States of America. It's a day when I think about the Declaration of Independence, and the ideals that were put forth in that document. I plan to re-read it with my morning cup of coffee.
It's a holiday for me, a day off where my family spends the time together, and partakes in some of the joys of summer, usually outdoor cooking, bike riding, or something else outdoors. We've watched Independence Day a few of the years, but this year we will likely spend some time in the mountains, enjoying some music and fresh air with the kids.
I hope it's a day off if you're in the US, or a slow, calm day elsewhere in the world. If you are looking for a little entertainment, I've got a short bloopers video for you.
SQL Prompt 5 is the effortless way to write, edit, and explore SQL. It's packed with features such as code completion, script summaries, and SQL reformatting, that make working with SQL a breeze. Try it now.
Fifty years after starting the 'Art of Computer Programming', Don Knuth is still working hard at the project. It is considered amongst the "hundred or so books that shaped a century of science”. Richard Morris asks him how things are going, and to find out more about his many achievements. More »
Question of the Day
Today's Question (by Steve Jones):
For the US Independence Day holiday, a fun one for you. Which three items in SSMS are colored red, white, and blue?
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
7 points in this category: humor.
We'd love to give you credit for your own question and answer.
To submit a QOD, simply log in to the
SQL Server 2012 T-SQL Recipes is an example-based guide to the Transact-SQL language that is at the core of SQL Server 2012. It provides ready-to-implement solutions to common programming and database administration tasks. Learn to create databases, insert and update data, generate reports, secure your data, and more. Tasks and their solutions are broken down into a problem/solution format that is quick and easy to read so that you can get the job done fast when the pressure is on. Get your copy from Amazon today.
Yesterday's Question of the Day
(by Kathiravan P):
What happens when this code is executed?
CREATE TABLE #MainTable
INSERT INTO #MainTable SELECT 1, 1.23
INSERT INTO #MainTable SELECT 2, 2.45
INSERT INTO #MainTable SELECT 3, 3
INSERT INTO #MainTable SELECT 4, 4.3
-- Statement 1
SELECT * FROM #MainTable WHERE Val LIKE '%'
-- Statement 2
SELECT * FROM #MainTable WHERE Val = '%'
Answer: Statement 1: Returns all rows. Statement 2: Error converting data type varchar to float.
Explanation: The SQL Server Database Engine converts the float values to character string for the LIKE since that operand requires strings. The first statement follows the rules of data type precedence and therefore the sting is converted to a float. Therefore the second statement gives an error.
SQL Server 2012 Query Performance Tuning leads you through understanding the causes of poor performance, how to identify them, and how to fix them. You’ll learn to be proactive in establishing performance baselines using tools like Performance Monitor and Extended Events. You’ll learn to recognize bottlenecks and defuse them before the phone rings. You’ll learn some quick solutions too, but emphasis is on designing for performance and getting it right, and upon heading off trouble before it occurs. Delight your users. Silence that ringing phone. Put the principles and lessons from SQL Server 2012 Query Performance Tuning into practice today.
This function extends for undocumented Microsoft SQL Server system function fn_varbintohexsubstring to get a hex string for a specified VARBINARY. The Microsoft function is currently restricted for VARBINARY (8000). This function is a wrapper for this function but is able to handle VARBINARY (MAX).
help with sp_MsForEachDb
- Hi everyone. I have created a table using the following code in sql2008:
CREATE TABLE dbo.databaseDataFileSize (
rowId INT IDENTITY(1,1),
Calculating date in time.
- How I create a function to get all policies that expire a 120 days from now.
Eg If the policy effectivedate...
Problem in executing bunch of Insert statements
- Hello friends,
I am executing bunch of Insert satements as follows:
INSERT INTO Table_Update(TableName,StartlastWritten) SELECT 'Students'As Tbl, MAX(LASTWRITTEN) AS StartLastWritten FROM...
- alter procedure [dbo].[pocc]
create TABLE #TempEmployees
-- Insert result from the SP to temp table
INSERT INTO #TempEmployees
SQL Server Replication
- Good Day. We configured a pull Replication with the Distributor residing on the Publisher. I am able to see transactions...
Session Execution Time On Cached/Snapshotted Reports
- I am currently using the following in the footer of all reports.
="Execution Time: " +
IIf(System.DateTime.Now.Subtract(Globals!ExecutionTime).TotalSeconds < 1, "0 seconds",
Access Query ported to SQL
- Here is the "inner" part of a query in Access.
UPDATE [Vehicle Detail] SET [Vehicle Detail].ReturnDate = #4/29/2013#, [Vehicle Detail].ReturnSource = 'ReturnProcess'
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.