Monthly Archives: January 2008

SQL Server Best Practices Analyzer (BPA)

A new version of the SQL Server 2005 Best Practices Analyzer (BPA) is here. On a related note, the BPA reported several operating system issues that I was unaware of, including an issue where SQL Server’s working set gets paged … Continue reading

Posted in SQL Server, Windows OS | Comments Off on SQL Server Best Practices Analyzer (BPA)

First stab at a database inventory script

Compatible with sql server 2k5: USE master CREATE TABLE #tempresults ( [name] sysname, db_size NVARCHAR(13), [owner] sysname, [dbid] smallint, created NVARCHAR(11), [status] NVARCHAR(600), compatibility_level tinyint ) INSERT INTO #tempresults EXEC sp_helpdb SELECT db.name, tr.db_size, db.compatibility_level,is_auto_shrink_on, state_desc, recovery_model_desc, page_verify_option_desc FROM sys.databases … Continue reading

Posted in SQL Server, T-SQL | Comments Off on First stab at a database inventory script

Code Prettifier

I found an easy way to render code snippets in HTML. It is called the Simple Talk Code Prettifier. In addition to rendering, it also converts SQL keywords to uppercase and gives you proper indentation.  Also supports VB.  http://www.simple-talk.com/prettifier/default.php By … Continue reading

Posted in SQL Server | Comments Off on Code Prettifier

Searching for a column name in a SQL database

Here are a couple of different ways to search for a column name within a SQL Server database: — using information_schema views (preferred method) SELECT sc.table_name    FROM information_schema.columns sc    INNER JOIN information_schema.tables st      ON sc.table_name = st.table_name … Continue reading

Posted in SQL Server, T-SQL | Comments Off on Searching for a column name in a SQL database