Use the Default System Trace to Find Autogrowth Events
Autogrowth events are very problematic and can cause sudden, unpredictable…
0 comments, 145 reads
Posted in SQL Tact on 3 May 2013
Hunt Down Tables Without Clustered Indexes
You'd be surprised how many vendors ship applications without a single index, much less properly aligned clustered indexes.
Heaps are bad. You can't defragment a heap by…
8 comments, 1,231 reads
Posted in SQL Tact on 3 May 2013
TRY_CONVERT broken by WITH SCHEMABINDING in SQL Server 2012 Data Tools build
To reproduce, run the following code in a SSDT database solution:
CREATE VIEW [dbo].[aview] WITH SCHEMABINDING AS SELECT id = TRY_CONVERT(int, id) FROM dbo.arealtable
The database project should build with this error:
0 comments, 241 reads
Posted in SQL Tact on 21 March 2013
Conversation History: The Continuing Case Against GUIDs
And before long, I had been goaded onto…
0 comments, 620 reads
Posted in SQL Tact on 8 March 2013
YYYYMM Math
For example, February 2013 would be stored as an integer, 201302.
As an aside, YYYYMM makes WAY more sense than ever storing anything MMYYYY. Why? For one, it sorts correctly. And…
0 comments, 149 reads
Posted in SQL Tact on 1 March 2013
"An item with the same key has already been added."
"An item with the same key has already been added."
Based on some quick googling, it looks like there are several potential causes for the error, but here's…
0 comments, 197 reads
Posted in SQL Tact on 28 February 2013
Script Out Foreign Keys With Multiple Keys
For example,
--Script 1 create table dbo.fktable1( id1 int not null , id2 int not null , id3 int…
0 comments, 170 reads
Posted in SQL Tact on 18 February 2013
Using Foreign Keys to Determine Table Insertion Order
with cteFK (pktable, fktable) as (
select
pktable = o1.name
, fktable = isnull(o2.name, '')
from sysobjects o1
left join sysforeignkeys fk on o1.id = fk.fkeyid
left…
0 comments, 127 reads
Posted in SQL Tact on 17 February 2013
Adding the Clustered Key To Your Nonclustered Index? Part 2
What if the table has a compound primary key? See comments for a play-by-play.
0 comments, 137 reads
Posted in SQL Tact on 5 February 2013
Adding the Clustered Key To Your Nonclustered Index?
From my colleague:
Why would you ever need…
1 comments, 156 reads
Posted in SQL Tact on 4 February 2013
Try a Database Design Exercise At Your Next SQL User Group
I think this was one of the most enjoyable meetings we've ever had, and certainly the most interactive.…
0 comments, 301 reads
Posted in SQL Tact on 10 January 2013
On the Advantages of DateTime2(n) over DateTime
Here's a brief review of how the precision of the datetime2 data type converts from a varchar representing a time value out to one ten-millionths of a second. Run…
0 comments, 500 reads
Posted in SQL Tact on 4 December 2012
Management Studio Database Diagram Owners
0 comments, 1,142 reads
Posted in SQL Tact on 3 December 2012
PowerPivot for Excel "Not loaded. The Managed Add-in Loader failed to initialize."
"Not loaded. The Managed Add-in Loader failed to initialize."
If the installation of the PowerPivot for Excel add-in succeeded, the add-in should be enabled in the Excel Add-ins options panel. If not, you might see the…
0 comments, 768 reads
Posted in SQL Tact on 30 November 2012
Database Design Contest at the 2012 AITP Region 3 Student Conference
0 comments, 229 reads
Posted in SQL Tact on 14 October 2012
Performance Tuning Presentation from October 2012 BRSSUG Meeting
I presented on SQL Server Performance tuning, which began with Michelle Ufford's article from GoDaddy on how she saw massive performance gains just by…
0 comments, 303 reads
Posted in SQL Tact on 11 October 2012
How BETWEEN is inclusive
Using the BETWEEN syntax is easy enough in a WHERE clause, and it's pretty obvious for numbers.
4 comments, 503 reads
Posted in SQL Tact on 26 September 2012
SQL Server Best Practices for DMV's - Houston Tech Fest 2012
Here's a link below for downloading the presentation files and sample scripts from my presentation on "SQL Server Best Practices for…
0 comments, 330 reads
Posted in SQL Tact on 8 September 2012
SQL Agent Alerts - Severity Condition is NOT "greater than or equal to"
As in, if I want to catch and notify an operator of all high severity errors 17 through 25, all I needed to do…
0 comments, 490 reads
Posted in SQL Tact on 20 August 2012
Actual Emails: The Customer Doesn't Want Full Recovery Mode
William
Hoping you can advise me on best way to handle this.
My client doesn’t want to use SQL backups. Instead, they are using VM and a third party backup software by choice.
Without a DBA on staff, they would…
2 comments, 322 reads
Posted in SQL Tact on 16 August 2012



Subscribe to this blog