Louis Davidson

Louis has been in the IT industry for over 20 years as a corporate database developer and data architect. Currently he is the Data Architect for CBN in Virginia Beach. Louis has been a Microsoft MVP since 2004, and is an active volunteer for the PASS locally and globally. He is the author of a series of SQL Server Database Design books, most recently Pro SQL Server Relational Database Design and Implementation.

Follow Louis on

30 July 2008
30 July 2008

Commenting your code

0
0
As I am easing back into real life from writing the book, I am in search of easy targets for blogging.  My boss mentioned this blog over on Jeff Atwood’s Coding Horror Blog and it got me thinking about commenting.  His advice is to only comment “why” the code works.  I can’t quite agree, because … Read more
0
0
13 July 2008
13 July 2008

Triggers…Evil?

0
0
Say it isn’t so. “It isn’t so.”  Glenn Berry thinks so in his post here. When I read his post I thought I was going to really get into it with Conor’s post here, called the Trouble with Triggers (a title which I had to post because I like Star Trek too,) but frankly I … Read more
0
0
23 March 2008
23 March 2008

Sequence Table Tricks

0
0
Ok, so I am writing about the kinds of things you can do with a sequence table, and I have built the table, I have the typical kinds of things planned (like splitting a string, and for the next section, loading a calendar table) but I wanted to do something interesting.  And frankly, sometimes the … Read more
0
0
05 March 2008
05 March 2008

2008: Error List in 2008

0
0
Ok, so I was looking around for a blurb about plan guides for my anti ad hoc SQL section of my book (ok, maybe not completely anti- but that isn’t the point,) when I found this blog: http://geekswithblogs.net/Sreeblog/articles/117576.aspx that basically just lists some new features in 2008.  One that I hadn’t seen I feel the … Read more
0
0
26 February 2008
26 February 2008

2008: Rebuilding a Heap

0
0
In 2005, rebuilding a table that was a heap (no clustered index) wasn’t easy.  You could copy it to a different table, or you could add a clustered index and then drop it. In 2008, this is a far easier thing to do.  They have added to the ALTER TABLE command a method to rebuild … Read more
0
0
05 December 2007
05 December 2007

Changing the owner of a database

0
0
Tonight, as I was creating my sample database for my chapter on implementing the database, I learned something new, that existed in 2005.  I had always used sp_changedbowner to change the owner of a database, but I was reading in another section about ALTER AUTHORIZATION earlier to change the owner of an object in a … Read more
0
0
04 November 2007
04 November 2007

sys.dm_exec_xml_handles

0
0
d Gives you information about any sessions that are using xml documents, including stats about the XML document and usage.  You can also get the statements that were used to create the XML handle using sys.dm_exec_sql_text to get the sql. Type: FunctionParameter: session_idData: Snapshot, values based on current realityColumns: session_id – the session_id of the … Read more
0
0
03 October 2007
03 October 2007

sys.dm_exec_sql_text

0
1
(Edit: Was reading Adam’s book tonight and discovered you can pass a plan handle to this object.  Very interesting!) This dynamic management object returns the SQL that was saved when a query was executed. This is a very exciting and useful thing to have, as there are dynamic management views that you will be able … Read more
0
1
25 September 2007
25 September 2007

PASS Followup, Technical Edition

0
0
I have already given a rundown of most everything PASS here on my personal blog, including a series of posts with pictures too over the days of PASS) but since this blog is all about things technical with SQL Server, I wanted to just rundown of some of the cool stuff I learned about SQL Server … Read more
0
0
26 August 2007
26 August 2007

sys.dm_db_index_operational_stats

0
1
  This object provides very useful stats on how many times an index has been used, locked, waited on, etc. An index in this context can mean several things: a clustered index, heap, index, or a partition of either of these. The grain of the function is down to the partition level, so if you … Read more
0
1
06 August 2007
06 August 2007

sys.dm_exec_query_optimizer_info

0
0
Information about how queries have been optimized since the server has been restarted. Note that counters are only affected when there is some sort of optimization event, not on every query. Type: View Data: Accumulating reset at restart Columns: counter – Name of the query occurrence – Number of times the counter was recorded to … Read more
0
0
27 July 2007
27 July 2007

sys.dm_io_virtual_file_stats

0
1
Excellent dmv that shows, for each file that SQL Server uses for the databases, stats on how frequently the file has been used by the database. This is one of the primary dynamic management views I use almost daily (well, not usually when I am on vacation, but even sometimes then!)  The file can be … Read more
0
1
22 July 2007
22 July 2007

sys.dm_db_index_usage_stats

0
0
This object gives statistics on how an index has been used to resolve queries. Most importantly it tells you the number of times a query was used to find a single row (user_seeks), a range of values, or to resolve a non-unique query (user_scans ), if it has been used to resolve a bookmark lookup … Read more
0
0
14 July 2007
14 July 2007

sys.dm_db_file_space_usage

0
0
Give space usage of objects in tempdb (most likely this will be extended to more than just tempdb in a future edition of SQL Server.) Can be used to see how and why space is being used in Tempdb, on a file by file basis. Type: View Data: temporal, reflects the current state of the … Read more
0
0