title: FxCop for SQL Server - Tool to analyze SQL Server databases for potential issues
body: <p>Is there a tool out there that can analyse SQL Server databases for potential problems? </p>
  
  <p>For example:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/836167/does-a-foreign-key-automatically-create-an-index">a foreign key column that is not indexed</a></li>
  <li>an index on a <code>uniqueidentifier</code> column that has no <code>FILL FACTOR</code></li>
  <li>a <code>LastModifiedDate DATETIME</code> column that has no <code>UPDATE</code> trigger to update the datetime</li>
  <li>a large index with "high" fragmentation</li>
  <li>a non-fragmented index that exists in multiple extents</li>
  <li>a trigger that does not contain <code>SET NOCOUNT ON</code> (leaving it suspectible to <em>"A trigger returned a resultset and/or was running with SET NOCOUNT OFF while another outstanding result set was active."</em>)</li>
  <li>a database, table, stored procedure, trigger, view, created with <code>SET ANSI_NULLS OFF</code></li>
  <li>a <a href="https://stackoverflow.com/questions/1415726/why-is-sql-server-deprecating-set-ansi-padding-off">database or table with <code>SET ANSI_PADDING OFF</code></a></li>
  <li>a database or table created with <code>SET CONCAT_NULL_YIELDS_NULL OFF</code></li>
  <li>a highly fragmented index that might benefit from a lower <code>FILLFACTOR</code> (i.e. more padding)</li>
  <li>a table with a very wide clustered index (e.g. uniqueidentifier+uniqueidentifier)</li>
  <li>a table with a non-unique clustered index</li>
  <li>use of <code>text/ntext</code> rather than <code>varchar(max)/nvarchar(max)</code></li>
  <li>use of <code>varchar</code> in columns that could likely contain localized strings and should be <code>nvarchar</code> (e.g. Name, FirstName, LastName, BusinessName, CountryName, City)</li>
  <li>use of <code>*=</code>, <code>=*</code>, <code>*=*</code> rather than <code>LEFT OUTER JOIN</code>, <code>RIGHT OUTER JOIN</code>, <code>FULL OUTER JOIN</code></li>
  <li><a href="http://msdn.microsoft.com/en-us/library/ms143729%28v=sql.110%29.aspx" rel="nofollow noreferrer">trigger that returns a results set</a></li>
  <li>any column declared as <code>timestamp</code> rather than <code>rowversion</code></li>
  <li>a nullable <code>timestamp</code> column</li>
  <li>use of <code>image</code> rather than <code>varbinary(max)</code></li>
  <li>databases not in simple mode (or a log file more than 100x the size of the data file)</li>
  </ul>
  
  <p>Is there an FxCop for SQL Server?</p>
  
  <p><strong>Note:</strong> The Microsoft SQL Server 2008 R2 Best Practices Analyzer <a href="http://www.bradmcgehee.com/2010/11/sql-server-2008-r2-best-practices-analyzer/" rel="nofollow noreferrer">doesn't fit the bill</a>.</p>