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

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
0
(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
0
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
0
  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
0
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. (reference: http://sqlserver-qa.net/blogs/perftune/archive/2007/05/11/get-statistics-on-query-plan-optimizer-execution.aspx ) Type: View Data: Accumulating reset at restart Columns: counter – Name of the query occurrence – Number of times the counter … Read more
0
0
27 July 2007
27 July 2007

sys.dm_io_virtual_file_stats

0
0
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
0
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
11 July 2007
11 July 2007

sys.dm_db_partition_stats

0
0
For the current database, gives you space oriented statistics for each partition of indexes (even if you only have one partion), like row count, page counts, etc. Resembles the sysindexes in previous versions of SQL Server, with more information. Type: view Data: accumulating, refreshed at server restart Scope: Reset on server restart (or object/partition drop … Read more
0
0
10 July 2007
10 July 2007

Blogging the DMV’s

0
0
Well, I am working on a project that is going to be a book on dynamic management views (and functions, but DMF is an interesting acronym, and objects, as in DMO, has a well known other meaning.  What I will post will be one object in the following format: Name of object Type: Function or … Read more
0
0
07 May 2007
07 May 2007

Using application locks to implement a critical section in T-SQL code

0
0
This is being added to the addendum (located here) for my “Pro SQL Server 2005 Database Design and Optimization” book and would have appeared in the pessimistic locking section on page 478 in Chapter 9: Coding for Integrity and Concurrency; Pessimistic Locking. You can download the entire addendum here: Addendum. The problem of the critical … Read more
0
0
03 April 2007
03 April 2007

SQL Server Search Macro (plus build your own directed search!)

0
0
Microsoft has built a little site for searching the books online on the web (which gives you links that are more readily shared with others): http://search.live.com/macros/sql_server_user_education/booksonline That is nice, but what is nicer is that you can create your own search macros and save them.. Just click the “create your own search engine” and go … Read more
0
0
26 February 2007
26 February 2007

Ten Common Database Design Mistakes

If database design is done right, then the development, deployment and subsequent performance in production will give little trouble. A well-designed database 'just works'. There are a small number of mistakes in database design that causes subsequent misery to developers, managewrs, and DBAs alike. Here are the ten worst mistakes … Read more