<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Joseph Sack's SQL Server Blog</title><link>http://www.sqljunkies.com/WebLog/joesack/default.aspx</link><description>"Many words lead to exhaustion." Tao Te Ching</description><dc:language>en-US</dc:language><generator>CommunityServer 1.0 (Build: 1.0.1.50214)</generator><item><title>SQL Server 2008 Table of Contents</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2008/07/22/146548.aspx</link><pubDate>Tue, 22 Jul 2008 13:44:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:146548</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/146548.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=146548</wfw:commentRss><description>Per an earlier post - here is a 
&lt;a title="recipes" href="http://joesack.com/WordPress/?p=139"&gt;
link &lt;/a&gt;

to a full version of the table of contents for "SQL Server 2008 Transact-SQL Recipes." Feel free to post comments if you have questions about the table of contents or topics listed.&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=146548" width="1" height="1"&gt;</description></item><item><title>Today I got the hard copy of SQL Server 2008 Transact-SQL Recipes</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2008/07/21/146455.aspx</link><pubDate>Mon, 21 Jul 2008 23:16:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:146455</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/146455.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=146455</wfw:commentRss><description>** Cross-posted from www.joesack.com **
&lt;BR&gt;&lt;BR&gt;
I came home to find a hard copy of my new book waiting for me.  This is always an exciting and strange moment to finally hold the finished product in my hand.  I'm pretty happy with the result, and I feel it reflects the problem/solution theme I was aiming for.  It is always a little daunting once a book is printed, because you have to hand it off to the world and hope that people find it useful.  You kind of have to just give in, hope for the best, and move on to the next project.
&lt;BR&gt;&lt;BR&gt;
It is a bigger book than last time (last book was 733 pages, this one is 839).  Although it was an update - it still took 9 months, but they were high quality hours and I enjoyed a good portion of it.
&lt;BR&gt;&lt;BR&gt;
Looking through it today -  I was disappointed to see that two of my requested changes that I submitted to the publisher in June didn't get integrated into to Chapter 2 - so I'll blog about them here so you can know to look for them.  There were some syntax changes that were made in the Release Candidate that differ from CTP 6.  The two changes that didn't get in for whatever reason are as follows:
&lt;BR&gt;&lt;BR&gt;
&lt;ul&gt;
	&lt;li&gt;Page 91 - the CTP6 version of the MERGE syntax, instead of the RC0 version was used.  Here is the corrected, RC0 version of the syntax:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;MERGE INTO HumanResources.CorporateHousing p
USING dbo.StagingCorporateHousing s
ON p.UnitNBR = s.UnitNBR&lt;BR&gt;
WHEN MATCHED AND s.IsRentedIND &lt;&gt; p.IsRentedIND THEN&lt;BR&gt;
UPDATE SET IsRentedIND = s.IsRentedIND&lt;BR&gt;
WHEN NOT MATCHED BY TARGET THEN&lt;BR&gt;
INSERT (UnitNBR, IsRentedIND) VALUES (s.UnitNBR, s.IsRentedIND)&lt;BR&gt;
WHEN NOT MATCHED BY SOURCE THEN&lt;BR&gt;
DELETE;
&lt;ul&gt;
	&lt;li&gt;Page 98 - the @partition_switch argument should be removed from sys.sp_cdc_enable_table&lt;/li&gt;
&lt;/ul&gt;
&lt;BR&gt;&lt;BR&gt;
The rest of the RC0 changes I made and requested seem to be there, so I'm happy.  We'll see if there are any RTM changes I need to blog about.  With 800 pages - the possibilities are endless. :)&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=146455" width="1" height="1"&gt;</description></item><item><title>SQL Server 2008 Transact-SQL Recipes</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2008/07/02/140775.aspx</link><pubDate>Wed, 02 Jul 2008 12:50:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:140775</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/140775.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=140775</wfw:commentRss><description>** Cross-posted on www.joesack.com **

&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;My new book, "&lt;a href="http://www.amazon.com/gp/product/1590599802?ie=UTF8&amp;amp;tag=wwwjoesackcom-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1590599802" title="recipes"&gt;SQL Server 2008 Transact-SQL Recipes&lt;/a&gt;" is coming out in a few weeks (estimated publication at the end of July). &lt;/font&gt;&lt;font face="Calibri"&gt;As of July 1&lt;sup&gt;st&lt;/sup&gt;, &lt;a href="http://www.amazon.com/gp/product/1590599802?ie=UTF8&amp;amp;tag=wwwjoesackcom-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1590599802" title="recipes"&gt;Amazon.com is selling it for $37.70&lt;/a&gt;. They don’t have a picture of the cover up yet, but it will have the standard bumble-bee color scheme Apress cover, so expect no surprises there. &lt;/font&gt;&lt;span&gt;&lt;span&gt;J&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;Although this was an update of my last book, it still took 9 months to write (plenty of weeknights and weekends holed up in my office).&lt;span&gt;  &lt;/span&gt;I updated existing content, and added content for both SQL Server 2008 and SQL Server 2005 SP2 additions. &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;Like my last book, I focus specifically on the Transact-SQL language. Even with the focus on T-SQL and not the GUI, the book wound up being greater than 800 pages.&lt;span&gt;  &lt;/span&gt;Also like the last book, I use a problem/solution format.&lt;span&gt;  &lt;/span&gt;The overall theme and mission statement for this book was:&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;span&gt; &lt;/span&gt;"Look up what you need to do. Learn how to do it. Do it."&lt;span&gt;  &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;I'll have a downloadable detailed index link available after the publication date.&lt;span&gt;  &lt;/span&gt;That link will include the specific recipes for each chapter.&lt;span&gt;  &lt;/span&gt;In the meantime, here is a high level list of the chapters:&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 1 SELECT&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 2 Perform, Capture, and Track Data Modifications&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 3 Transactions, Locking, Blocking, and Deadlocking&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 4 Tables &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 5 Indexes &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 6 Full-Text Search &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 7 Views &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 8 SQL Server Functions &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 9 Conditional Processing, Control-of-Flow, and Cursors &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 10 Stored Procedures &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 11 User-Defined Functions and Types &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 12 Triggers &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 13 CLR Integration&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 14 XML, Hierarchies, and Spatial Data&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 15 Hints &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 16 Error Handling &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 17 Principals &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 18 Securables, Permissions, and Auditing &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 19 Encryption&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 20 Service Broker&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 21 Configuring and Viewing SQL Server Options&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 22 Creating and Configuring Databases &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 23 Database Integrity and Optimization&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 24 Maintaining Database Objects and Object Dependencies &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 25 Database Mirroring &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 26 Database Snapshots &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 27 Linked Servers and Distributed Queries &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 28 Query Performance Tuning &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;CHAPTER 29 Backup and Recovery &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="Calibri"&gt;I enjoyed writing this book; but most importantly I hope you find it to be a useful, practical reference.&lt;span&gt;  &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=140775" width="1" height="1"&gt;</description></item><item><title>Example of how SET options impact the Query Optimizer index choice</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2008/01/08/102561.aspx</link><pubDate>Wed, 09 Jan 2008 03:46:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:102561</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/102561.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=102561</wfw:commentRss><description>I put together a scenario that demonstrates how a query session’s SET options can impact which index is used by the Query Optimizer.  In this example, I’ll start off by creating a schema-bound view in the AdventureWorks database:&lt;BR&gt;&lt;BR&gt;

&lt;code&gt;
CREATE VIEW dbo.vw_SalesOrderDetail&lt;BR&gt;
WITH SCHEMABINDING&lt;BR&gt;
AS&lt;BR&gt;
SELECT SalesOrderID, SalesOrderDetailID,&lt;BR&gt;
       CarrierTrackingNumber, ProductID, LineTotal&lt;BR&gt;
FROM Sales.SalesOrderDetail&lt;BR&gt;
WHERE LineTotal BETWEEN 35.000 AND 50.000&lt;BR&gt;
GO&lt;BR&gt;&lt;BR&gt;
&lt;/code&gt;
Next, I’ll create two indexes on the view I just created.  The first index is a unique clustered index on the composite key of the underlying base table, and the second index is nonclustered on the CarrierTrackingNumber column:&lt;BR&gt;&lt;BR&gt;

&lt;code&gt;
CREATE UNIQUE CLUSTERED INDEX &lt;BR&gt;idx_vw_SalesOrderDetail_Unique ON&lt;BR&gt;
 dbo.vw_SalesOrderDetail (SalesOrderID, &lt;BR&gt;SalesOrderDetailID)&lt;BR&gt;
GO&lt;BR&gt;&lt;BR&gt;

CREATE INDEX &lt;BR&gt;idx_vw_SalesOrderDetail_CarrierTrackingNumber ON&lt;BR&gt;
   dbo.vw_SalesOrderDetail (CarrierTrackingNumber)
GO&lt;BR&gt;&lt;BR&gt;
&lt;/code&gt;

Now I’ll show the estimated query execution plan for a query that selects against the base table (on top of which I created the view and associated indexes):&lt;BR&gt;&lt;BR&gt;

&lt;code&gt;
SET SHOWPLAN_ALL ON&lt;BR&gt;
GO&lt;BR&gt;&lt;BR&gt;

SELECT SalesOrderID, SalesOrderDetailID,&lt;BR&gt;
       CarrierTrackingNumber, ProductID, LineTotal&lt;BR&gt;
FROM Sales.SalesOrderDetail&lt;BR&gt;
WHERE CarrierTrackingNumber = ‘8E3A-4564-99′ AND&lt;BR&gt;
 LineTotal BETWEEN 35.000 AND 50.000&lt;BR&gt;&lt;BR&gt;
&lt;/code&gt;

The argument column of the 4th row of the SHOWPLAN_ALL recordset reveals an Index Seek against the following object:&lt;BR&gt;&lt;BR&gt;

&lt;code&gt;
OBJECT:([AdventureWorks].[dbo].&lt;BR&gt;[vw_SalesOrderDetail].&lt;BR&gt;[idx_vw_SalesOrderDetail_CarrierTrackingNumber]), SEEK:([AdventureWorks].[dbo].&lt;BR&gt;[vw_SalesOrderDetail].[CarrierTrackingNumber]=N’8E3A-4564-99′) ORDERED FORWARD&lt;BR&gt;&lt;BR&gt;
&lt;/code&gt;

Even though I was just querying the base table - the query optimizer was able to figure out that the index on the CarrierTrackingNumber column for the indexed view would be a good choice for the query.&lt;BR&gt;&lt;BR&gt;

Now I'll show the estimated query again - this time designating a different SET option from my session default:&lt;BR&gt;&lt;BR&gt;

&lt;code&gt;
SET SHOWPLAN_ALL ON&lt;BR&gt;
GO&lt;BR&gt;&lt;BR&gt;

SET QUOTED_IDENTIFIER OFF&lt;BR&gt;
GO&lt;BR&gt;&lt;BR&gt;

SELECT SalesOrderID, SalesOrderDetailID,&lt;BR&gt;
       CarrierTrackingNumber, ProductID, LineTotal
FROM Sales.SalesOrderDetail&lt;BR&gt;
WHERE CarrierTrackingNumber = ‘8E3A-4564-99′ AND&lt;BR&gt;
 LineTotal BETWEEN 35.000 AND 50.000&lt;BR&gt;&lt;BR&gt;
&lt;/code&gt;

Looking in the SHOWPLAN_ALL result set - the Index Seek we saw before is missing - replaced by a Clustered Index Scan against the base table:&lt;BR&gt;&lt;BR&gt;

&lt;code&gt;
OBJECT:([AdventureWorks].[Sales].&lt;BR&gt;[SalesOrderDetail].&lt;BR&gt;[PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID])&lt;BR&gt;&lt;BR&gt;
&lt;/code&gt;

What happenend?  Index views require that the QUOTED_IDENTIFIER be set ON when the view is created (as well as some other SET options documented in BOL).  In order for the Query Optimizer to use the index on the view, these SET options need to match.  If they don’t - the Query Optimizer doesn’t consider the index for the query execution plan. 
&lt;BR&gt;&lt;BR&gt;
Cross-posted from www.JoeSack.com.&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=102561" width="1" height="1"&gt;</description></item><item><title>Identify implicit data type conversions using XQuery</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2008/01/01/102466.aspx</link><pubDate>Tue, 01 Jan 2008 17:45:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:102466</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/102466.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=102466</wfw:commentRss><description>It has been a long time since I have posted, but in 2008 I will try to be better about it.  I've been regularly blogging at www.joesack.com - however I'll be cross-posting to SQLJunkies.com again too (now that I found my login and password).
&lt;BR&gt;&lt;BR&gt;

On to the topic at hand...
&lt;BR&gt;&lt;BR&gt;

Implicit data type conversion is a non-obvious operation that can eat away at your query performance.  Let’s say you have a column called “EmployeeID” in your database. This is recognized as the employer identifier, and it is understood by the application team that an EmployeeID in Table “A” is the same as an EmployeeID in Table “B”.  However one database developer uses a bigint for Table “A” and maybe a varchar for Table “B”.  You have just built in a hidden cost to all queries that join Table “B” and Table “A” on EmployeeID.  Add millions of rows to those tables, and you have just added a potentially significant cost.
&lt;BR&gt;&lt;BR&gt;

How do you identify data type mismatches for the same column then?  One method is to look at INFORMATION_SCHEMA.columns and look for all matching names that have varying data types.  We can also check INFORMATION_SCHEMA.parameters and see any parameter names that have varying data types. The flaw here though, is that we depend on matching names.  If the database designer named a column “EmpID” and another “EmployeeID” - we will have to be very familiar with the database and application design in order to know for sure that these two columns really represent the same thing. We are also limited to checking persisted objects - tables and procedures for example - and not ad hoc queries that contain implicit data type conversions in temporary tables or operations passing values from one query to another…
&lt;BR&gt;&lt;BR&gt;

One solution introduced in SQL Server 2005, is the ability to use XQuery to probe the contents of an execution plan.  If an implicit data type conversion occurs for a query, we can identify it in the XML query plan.  I created the following query that uses the “exists” method to check for any query plan that has the implicit attribute set to “1″.  I order it by worker time, looking for those queries with significant CPU usage.  I also look at execution count - for those queries that are executed frequently:
&lt;BR&gt;&lt;BR&gt;

&lt;code&gt;
SELECT qs.total_worker_time,&lt;BR&gt;
  SUBSTRING(st.text, qs.statement_start_offset/2,&lt;BR&gt;
   (CASE&lt;BR&gt;
    WHEN qs.statement_end_offset = -1&lt;BR&gt;
     THEN LEN(CONVERT(nvarchar(max), st.text)) * 2&lt;BR&gt;
    ELSE qs.statement_end_offset&lt;BR&gt;
   END - qs.statement_start_offset)/2)&lt;BR&gt;
  as SQL_Text,&lt;BR&gt;
  qp.query_plan,&lt;BR&gt;
  qs.execution_count,&lt;BR&gt;
  st.dbid,&lt;BR&gt;
  st.objectid&lt;BR&gt;
FROM sys.dm_exec_query_stats qs&lt;BR&gt;
CROSS APPLY sys.dm_exec_query_plan &lt;BR&gt;(qs.plan_handle) qp&lt;BR&gt;
CROSS APPLY sys.dm_exec_sql_text (qs.plan_handle) st&lt;BR&gt;
WHERE query_plan.exist&lt;BR&gt;
(’declare default element namespace “http://schemas.microsoft.com/sqlserver/2004/07/showplan“;&lt;BR&gt;
//Convert/@Implicit[. = “1″]’) = 1&lt;BR&gt;
ORDER BY qs.total_worker_time DESC&lt;BR&gt;
&lt;/code&gt;

&lt;BR&gt;&lt;BR&gt;
Once you have identified the higher cost plans, you can validate the predicates and see where the implicit data type conversions are occurring and then address accordingly.&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=102466" width="1" height="1"&gt;</description></item><item><title>SQL Server 2005 Instant File Initialization</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2006/08/24/22632.aspx</link><pubDate>Thu, 24 Aug 2006 17:42:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:22632</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/22632.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=22632</wfw:commentRss><description>&lt;P&gt;&lt;FONT&gt;I was asked about instant file initialization for SQL Server 2005 yesterday, and also saw a similar question/response on a newsgroup, so I thought I would drop a quick reminder here as well.&amp;nbsp; As you may already know, in SQL Server 2005 data files are initialized immediately when created.&amp;nbsp; Unlike with SQL Server 2000, SQL Server 2005 does not fill the files with zeros during creation or expansion.&amp;nbsp; For large files, skipping this operation&amp;nbsp;can save quite a bit of&amp;nbsp;time.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;Notice, however, that&amp;nbsp;the&amp;nbsp;instant file initialization&amp;nbsp;feature applies to &lt;STRONG&gt;data&lt;/STRONG&gt; and &lt;EM&gt;not &lt;/EM&gt;transaction log files.&amp;nbsp; If you have large LDF files the must be created, expanded, or restored, you'll still take a performance hit.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=22632" width="1" height="1"&gt;</description></item><item><title>Radio Silence</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2006/04/04/20097.aspx</link><pubDate>Wed, 05 Apr 2006 01:07:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:20097</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/20097.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=20097</wfw:commentRss><description>&lt;P&gt;&lt;FONT&gt;Not that I've been that great about posting to my blog, but I've been particularly silent lately due to a few big life changes.&amp;nbsp; One of the life changes is my new job with Microsoft.&amp;nbsp; I&amp;nbsp;became an employee&amp;nbsp;three weeks ago, working for the Consulting for IT Operations group.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;I'm having a great time and am busily trying to sift through the fire hose of information. &lt;/FONT&gt;&lt;FONT&gt;As such, I'll be keeping radio silence on my blog for the forseeable future.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;I have to say that SQLJunkies has been invaluable to me and I appreciate all the contributors (especially those who posted regularly - unlike myself)!&amp;nbsp; Thank you Donny and Doug!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;- Joe&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=20097" width="1" height="1"&gt;</description></item><item><title>Quick Reference Cards in PDF format</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2006/02/28/18292.aspx</link><pubDate>Tue, 28 Feb 2006 14:27:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:18292</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/18292.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=18292</wfw:commentRss><description>&lt;P&gt;&lt;FONT&gt;Okay - although this is tangential to SQL Server itself,&amp;nbsp;&lt;/FONT&gt;&lt;A href="http://www.digilife.be/quickreferences/quickrefs.htm"&gt;&lt;FONT&gt;I thought this link may be of interest&lt;/FONT&gt;&lt;/A&gt;&lt;FONT&gt;&amp;nbsp;for those SQL Server professionals that dabble in other programming paradigms.&amp;nbsp; This site includes links to quick reference cards (in PDF format).&amp;nbsp; Syntax references for JSP, C, Java, C++, Perl, PHP, UML, XML and more.&amp;nbsp; I'm sad that Transact-SQL isn't in that list, nor&amp;nbsp;.NET - but perhaps someone out there in&amp;nbsp;web-land&amp;nbsp;will fill that gap.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=18292" width="1" height="1"&gt;</description></item><item><title>Don't use disk compression with SQL Server files</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2006/02/20/18169.aspx</link><pubDate>Mon, 20 Feb 2006 15:00:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:18169</guid><dc:creator>joe.sack</dc:creator><slash:comments>1</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/18169.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=18169</wfw:commentRss><description>&lt;P&gt;&lt;FONT&gt;Using compressed volumes with SQL Server can impact both performance and recoverability.&amp;nbsp; For more details, check out the Microsoft Knowledge Base Article:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT&gt;&lt;A href="http://support.microsoft.com/kb/231347/en-us"&gt;http://support.microsoft.com/kb/231347/en-us&lt;/A&gt;&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=18169" width="1" height="1"&gt;</description></item><item><title>SQL Profiler Events: The difference between RPC:Completed and SP:Completed</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2006/02/10/17987.aspx</link><pubDate>Fri, 10 Feb 2006 19:27:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:17987</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/17987.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=17987</wfw:commentRss><description>&lt;P&gt;&lt;FONT&gt;Ever wondered what the difference was between the RPC:Completed and SP:Completed SQL Profiler events?&amp;nbsp; Andrew J. Kelly, SQL MVP, gives an &lt;/FONT&gt;&lt;A href="http://groups.google.com/group/microsoft.public.sqlserver.tools/browse_thread/thread/30a6705262606b19/393e5028dedbddd1?lnk=st&amp;amp;q=RPC%3ACompleted+and+SP%3ACompleted+andrew+kelly&amp;amp;rnum=1#393e5028dedbddd1"&gt;&lt;FONT&gt;excellent explanation here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=17987" width="1" height="1"&gt;</description></item><item><title>Complex systems and SQL Server</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2006/01/04/17754.aspx</link><pubDate>Wed, 04 Jan 2006 15:55:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:17754</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/17754.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=17754</wfw:commentRss><description>&lt;P&gt;&lt;SPAN&gt;"If you manage a complex system you will frequently, if not always, be wrong." This is a quote from Michael Crichton’s speech "&lt;A href="http://www.michaelcrichton.com/speeches/complexity/complexity.html"&gt;Fear, Complexity, &amp;amp; Environmental Management in the 21st Century&lt;/A&gt;".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In his speech, he talks about how it is human nature to make linear assumptions about non-linear, complex systems.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Although he discussed this within the context of global, environmental, political, and biological issues – it got me thinking about the feature expansion of SQL Server 2005 and performance tuning/optimization.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As SQL Server professionals we can make a certain amount of fair assumptions.&amp;nbsp; We can coin "best" and "worst" practices - and suggest design and architecture choices that, on average, yield optimal results under certain circumstances.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;SQL Server performance tuning, however, is one of the more slippery topics.&amp;nbsp; A "my query runs too long" issue from an end-user could be the result of several factors such as hardware, network, database design, sizing, query construction, and concurrent query traffic.&amp;nbsp; Embedded within each of these factors is an array of other considerations - statistics, fragmentation, cursor-usage versus set-processing, query hints, sp_configure settings, locking...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Unlike complex systems like weather or government, you do have much more control over how your SQL Server instance is configured. Also, over time a SQL Server professional develops a repertoire of troubleshooting patterns – problem/responses that build up over time, allowing him or her to fix issues quickly.&amp;nbsp; There is both danger and benefit from this gained experience.&amp;nbsp; The benefit is that you fix issues more quickly than someone who hasn’t experienced the problem before.&amp;nbsp; The danger/drawback is that you may lead yourself down the wrong path without considering other avenues.&amp;nbsp; Even after eight years of working closely with SQL Server, I still try to collect a sufficient amount of information before coming to a conclusion.&amp;nbsp; Snap-judgments based on a single email complaint or discussion can often lead to incorrect assumptions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Michael Crichton says that when you make predictions on complex systems which are incorrect, that "you have to backtrack. You have to acknowledge error. You’ve probably learned that with your children. Or, if you don’t have children, with your bosses."&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Being a SQL Server professional, there is always more to learn (which is why I love this profession) - but if you are incautious in your troubleshooting approach, you'll soon be humbled.&amp;nbsp; This is the reality of a complex system.&lt;BR&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=17754" width="1" height="1"&gt;</description></item><item><title>RS T-SQL tip: Identify which reports are being emailed via subscriptions in Reporting Services 2000</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2006/01/03/17745.aspx</link><pubDate>Tue, 03 Jan 2006 17:54:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:17745</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/17745.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=17745</wfw:commentRss><description>&lt;P&gt;&lt;FONT&gt;If you need to identify which reports are emailed to specific users (either to remove them from the subscription - or just as an FYI), you can execute the following query in the ReportServer, SQL Server 2000 Reporting Services&amp;nbsp;database:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;SELECT [Name] ReportName&lt;BR&gt;FROM ReportServer.dbo.Catalog&lt;BR&gt;WHERE ItemID IN (SELECT Report_OID&lt;BR&gt;&amp;nbsp;&amp;nbsp; FROM ReportServer.dbo.Subscriptions&lt;BR&gt;&amp;nbsp;&amp;nbsp; WHERE ExtensionSettings LIKE &lt;/FONT&gt;&lt;A href="mailto:'%joesack@test.com%'"&gt;&lt;FONT&gt;'%joesack@test.com%'&lt;/FONT&gt;&lt;/A&gt;&lt;FONT&gt;)&lt;BR&gt;ORDER BY Name&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;Wildcards are used as the email is embedded in an XML format in the ExtensionSettings column. The query example then&amp;nbsp;returns any reports with a subscription email to &lt;/FONT&gt;&lt;A href="mailto:joesack@test.com"&gt;&lt;FONT&gt;joesack@test.com&lt;/FONT&gt;&lt;/A&gt;&lt;FONT&gt;.&lt;/FONT&gt; &lt;/P&gt;&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=17745" width="1" height="1"&gt;</description></item><item><title>SSIS BUG - Migrate DTS 2000 Package fails when pulling packages with trailing blanks</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2006/01/03/17743.aspx</link><pubDate>Tue, 03 Jan 2006 16:13:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:17743</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/17743.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=17743</wfw:commentRss><description>&lt;P&gt;&lt;FONT&gt;So today I was testing out the SSIS "Migrate DTS 2000 Package" wizard.&amp;nbsp; I went through the following steps:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;1.&amp;nbsp; In BIDS, I right-clicked the SSIS Packages folder in the Solution Explorer.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;2.&amp;nbsp; Selected Next at the Wizard intro.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;3.&amp;nbsp; Selected the source location (where I'll be pulling the packages from).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;4.&amp;nbsp; Selected the destination location (the folder where the converted packages will reside).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;On the next dialog box I'm supposed to see a list of DTS 2000 packages on the source SQL Server instance, but instead I get the error:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;"&lt;/FONT&gt;&lt;FONT&gt;&lt;FONT&gt;Index was out of range. Must be non-negative and less than the size of the collection.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;Parameter name: index (mscorlib)"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;After digging through the newsgroups, I found a tip that this was caused by trailing blanks in the DTS package names.&amp;nbsp; I ran the following query to identify the offending packages:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;SELECT DISTINCT name&lt;BR&gt;FROM msdb.dbo.sysdtspackages &lt;BR&gt;WHERE name LIKE '% '&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;After renaming the packages (removing trailing blanks) - the List Packages dialog box worked!&amp;nbsp; Thanks &lt;A href="http://groups.google.com/group/microsoft.public.sqlserver.dts/browse_thread/thread/e72c31abf8943e31/d8a681b34f94c19a?lnk=st&amp;amp;q=dts+Index+was+out+of+range.+Must+be+non-negative+and+less+than+the+size+of+the+collection.&amp;amp;rnum=2&amp;amp;hl=en#d8a681b34f94c19a"&gt;Koni Kogan! &lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=17743" width="1" height="1"&gt;</description></item><item><title>SQL Server 2005 T-SQL Recipes: A Problem-Solution Approach</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2005/11/30/17503.aspx</link><pubDate>Thu, 01 Dec 2005 03:38:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:17503</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/17503.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=17503</wfw:commentRss><description>&lt;IMG title="SQL Server 2000 Fast Answers" alt="" src="/WebLog/photos/joesack/images/17502/original.aspx"&gt;&amp;nbsp; 
&lt;P&gt;My new book "SQL Server 2005 T-SQL Recipes: A Problem-Solution Approach" has been printed and will be shipped in less than two weeks (December 12th).&amp;nbsp; You can pre-order it now. As of today, Amazon is selling it for $37.79 at this &lt;A href="http://www.amazon.com/gp/product/159059570X/qid=1133407875/sr=8-4/ref=sr_8_xs_ap_i2_xgl14/002-6971036-1618435?n=507846&amp;amp;s=books&amp;amp;v=glance"&gt;&lt;U&gt;&lt;FONT&gt;link&lt;/U&gt;&lt;/FONT&gt;&lt;/A&gt;. Amazon hasn't updated the book information with the latest page count and description - but this should be updated soon. In the meantime, you can check out the up-to-date book specs on Apress &lt;A href="http://www.apress.com/book/bookDisplay.html?bID=10045"&gt;&lt;U&gt;&lt;FONT&gt;here&lt;/U&gt;&lt;/FONT&gt;&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;On a side note - my Grandmother told me she doesn't like&amp;nbsp;the author photo. I told her that luckily it will be on the &lt;I&gt;back &lt;/I&gt;of the book, and not the front.&lt;/P&gt;
&lt;P&gt;I wrote &lt;EM&gt;SQL Server 2005 T-SQL Recipes&lt;/EM&gt;&amp;nbsp;in a problem/solution style, including hundreds of "How To" scenarios for SQL Server development and administration tasks. The table of contents is as follows (I don't include the detailed chapter break-out here - as that's several pages long):&lt;/P&gt;
&lt;P&gt;CHAPTER 1 SELECT&lt;/P&gt;
&lt;P&gt;CHAPTER 2 INSERT, UPDATE, DELETE&lt;/P&gt;
&lt;P&gt;CHAPTER 3 Transactions, Locking, Blocking, and Deadlocking &lt;/P&gt;
&lt;P&gt;CHAPTER 4 Tables&lt;/P&gt;
&lt;P&gt;CHAPTER 5 Indexes &lt;/P&gt;
&lt;P&gt;CHAPTER 6 Full-Text Search&lt;/P&gt;
&lt;P&gt;CHAPTER 7 Views &lt;/P&gt;
&lt;P&gt;CHAPTER 8 SQL Server Functions&lt;/P&gt;
&lt;P&gt;CHAPTER 9 Conditional Processing, Control-Of-Flow, and Cursors&lt;/P&gt;
&lt;P&gt;CHAPTER 10 Stored Procedures &lt;/P&gt;
&lt;P&gt;CHAPTER 11 User-Defined Functions and Types &lt;/P&gt;
&lt;P&gt;CHAPTER 12 Triggers &lt;/P&gt;
&lt;P&gt;CHAPTER 13 CLR Integration&lt;/P&gt;
&lt;P&gt;CHAPTER 14 XML&lt;/P&gt;
&lt;P&gt;CHAPTER 15 Web Services&lt;/P&gt;
&lt;P&gt;CHAPTER 16 Error Handling&lt;/P&gt;
&lt;P&gt;CHAPTER 17 Principals &lt;/P&gt;
&lt;P&gt;CHAPTER 18 Securables and Permissions &lt;/P&gt;
&lt;P&gt;CHAPTER 19 Encryption&lt;/P&gt;
&lt;P&gt;CHAPTER 20 Service Broker &lt;/P&gt;
&lt;P&gt;CHAPTER 21 Configuring and Viewing SQL Server Options &lt;/P&gt;
&lt;P&gt;CHAPTER 22 Creating and Configuring Databases &lt;/P&gt;
&lt;P&gt;CHAPTER 23 Database Integrity and Optimization&lt;/P&gt;
&lt;P&gt;CHAPTER 24 Maintaining Database Objects and Object Dependencies&lt;/P&gt;
&lt;P&gt;CHAPTER 25 Database Mirroring&lt;/P&gt;
&lt;P&gt;CHAPTER 26 Database Snapshots &lt;/P&gt;
&lt;P&gt;CHAPTER 27 Linked Servers and Distributed Queries &lt;/P&gt;
&lt;P&gt;CHAPTER 28 Performance Tuning &lt;/P&gt;
&lt;P&gt;CHAPTER 29 Backup and Recovery&lt;/P&gt;
&lt;P&gt;I hope that readers find it useful, and I'm looking forward to hearing the feedback.&lt;/P&gt;&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=17503" width="1" height="1"&gt;</description></item><item><title>SQL Server 2005 System Views Diagram in SQL Server Magazine</title><link>http://www.sqljunkies.com/WebLog/joesack/archive/2005/11/30/17501.aspx</link><pubDate>Thu, 01 Dec 2005 03:00:00 GMT</pubDate><guid isPermaLink="false">d2584c15-f6ef-46f7-a2d4-24fc0e143e76:17501</guid><dc:creator>joe.sack</dc:creator><slash:comments>0</slash:comments><comments>http://www.sqljunkies.com/WebLog/joesack/comments/17501.aspx</comments><wfw:commentRss>http://www.sqljunkies.com/WebLog/joesack/commentrss.aspx?PostID=17501</wfw:commentRss><description>&lt;P&gt;I just got the December copy of SQL Server Magazine, and it includes a big pull-out SQL Server 2005 System Views Diagram.&amp;nbsp; I'll be bringing it to work so I can scare and impress my co-workers.&amp;nbsp; It separates out the views using the following categories: &lt;/P&gt;
&lt;P&gt;Objects, Types &amp;amp; Indexes, Linked Servers, Common Language Runtime, Partitioning, Trace and Eventing, Databases and Storage, Server-wide Information, Transaction Information, Server Wide Configurations, Security, Endpoints, Database Mirroring, and Service Broker.&amp;nbsp; Object types are orange for Dynamic Management Views, blue for Catalog Views, and purple for System Administration views.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;If anyone is aware of a digital copy of this diagram - let me know (I looked for it - but not very hard).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://www.sqljunkies.com/WebLog/aggbug.aspx?PostID=17501" width="1" height="1"&gt;</description></item></channel></rss>