<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>SQL Server</title>
        <link>http://geekswithblogs.net/influent1/category/6296.aspx</link>
        <description>SQL Server</description>
        <language>en-US</language>
        <copyright>Alex Bransky</copyright>
        <managingEditor>alex18@rocketmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>drop and recreate sql server indexes</title>
            <link>http://geekswithblogs.net/influent1/archive/2012/01/04/148243.aspx</link>
            <description>I have a real-time reporting server with a database which is basically a copy of my production database, but it's populated using transactional replication and replication only copies the primary keys over, i.e. none of the secondary indexes are included.  So what I do is every time I need to recreate replication--which is every deployment with schema changes--I script out DROPs and CREATEs for all the reporting indexes I've created and then run the script after replication has been recreated.  The script I use is a modified conglomeration of scripts I've found on the Internet, but you may find it useful.  Note that it excludes primary keys and some other things.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;font face="Courier New" size="2"&gt;PRINT '-------------------------  DROP INDEXES     ----------------------------------------------------'&lt;br /&gt;DECLARE @ownername SYSNAME&lt;br /&gt;DECLARE @tablename SYSNAME&lt;br /&gt;DECLARE @indexname SYSNAME&lt;br /&gt;DECLARE @sql NVARCHAR(4000)&lt;br /&gt;DECLARE dropindexes CURSOR FOR&lt;br /&gt;    SELECT indexes.name, objects.name, schemas.name&lt;br /&gt;    FROM sys.indexes&lt;br /&gt;    JOIN sys.objects ON indexes.OBJECT_ID = objects.OBJECT_ID&lt;br /&gt;    JOIN sys.schemas ON objects.schema_id = schemas.schema_id&lt;br /&gt;    WHERE indexes.index_id &amp;gt; 0&lt;br /&gt;      AND indexes.index_id &amp;lt; 255&lt;br /&gt;      AND objects.is_ms_shipped = 0&lt;br /&gt;      AND NOT EXISTS (SELECT 1 FROM sys.objects WHERE objects.name = indexes.name)&lt;br /&gt;    ORDER BY indexes.name &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--SELECT * FROM sys.stats&lt;br /&gt;OPEN dropindexes&lt;br /&gt;FETCH NEXT FROM dropindexes INTO @indexname, @tablename, @ownername&lt;br /&gt;WHILE @@fetch_status = 0&lt;br /&gt;BEGIN&lt;br /&gt;  SET @sql = N'IF EXISTS (SELECT 1 FROM sys.indexes i WHERE i.name = ''' + @indexname +  ''') DROP INDEX '+QUOTENAME(@ownername)+'.'+QUOTENAME(@tablename)+'.'+QUOTENAME(@indexname)&lt;br /&gt;  PRINT @sql  &lt;br /&gt;  FETCH NEXT FROM dropindexes INTO @indexname, @tablename, @ownername&lt;br /&gt;END&lt;br /&gt;CLOSE dropindexes&lt;br /&gt;DEALLOCATE dropindexes&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PRINT CHAR(10) + CHAR(13) + '-------------------------  CREATE INDEXES     ----------------------------------------------------'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;declare&lt;br /&gt;@object_id          int,&lt;br /&gt;@index_id           tinyint,&lt;br /&gt;@schema_name        sysname,&lt;br /&gt;@table_name         sysname,&lt;br /&gt;@index_name         sysname,&lt;br /&gt;@type               tinyint,&lt;br /&gt;@uniqueness         bit,&lt;br /&gt;@indexed_column     sysname,&lt;br /&gt;@included_column    sysname,&lt;br /&gt;@indexed_columns    varchar(max),&lt;br /&gt;@included_columns   varchar(max),&lt;br /&gt;@has_included_cols  bit,&lt;br /&gt;@is_descending_key  bit,&lt;br /&gt;@stmt               varchar(max),&lt;br /&gt;@crlf               char(2)&lt;br /&gt;&lt;br /&gt;set @crlf = char(13) + char(10)&lt;br /&gt;&lt;br /&gt;declare indexes cursor&lt;br /&gt;for&lt;br /&gt;    select &lt;br /&gt;    schema_name     = s.name,&lt;br /&gt;    table_name      = t.name,&lt;br /&gt;    index_id        = i.index_id,&lt;br /&gt;    index_name      = i.name,&lt;br /&gt;    type            = i.type,&lt;br /&gt;    uniqueness      = i.is_unique&lt;br /&gt;from &lt;br /&gt;         sys.schemas            s&lt;br /&gt;    join sys.tables             t   on s.schema_id = t.schema_id&lt;br /&gt;    join sys.indexes            i   on t.object_id = i.object_id&lt;br /&gt;where&lt;br /&gt;    i.type &amp;gt; 0  -- none -heap&lt;br /&gt;    AND I.index_id &amp;gt; 0 -- ignore PKs&lt;br /&gt;    AND I.index_id &amp;lt; 255 &lt;br /&gt;    AND i.type = 2&lt;br /&gt;    AND INDEXPROPERTY (I.object_id,I.NAME,'ISCLUSTERED') =0&lt;br /&gt;    AND left(I.object_id,3) not in ('sys', 'dt_')&lt;br /&gt;    AND left(I.name,3) not in ('PK_', 'UQ_','nci','ucm','ci_','uk_')&lt;br /&gt;order &lt;br /&gt;    by i.name&lt;br /&gt;&lt;br /&gt;open indexes&lt;br /&gt;&lt;br /&gt;fetch &lt;br /&gt;    indexes&lt;br /&gt;into&lt;br /&gt;    @schema_name,&lt;br /&gt;    @table_name ,&lt;br /&gt;    @index_id   ,&lt;br /&gt;    @index_name ,&lt;br /&gt;    @type       ,&lt;br /&gt;    @uniqueness &lt;br /&gt;&lt;br /&gt;while @@fetch_status&amp;lt;&amp;gt;(-1)&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;    select @object_id = object_id(@schema_name + '.' + @table_name)&lt;br /&gt;    set @indexed_columns = '('&lt;br /&gt;&lt;br /&gt;    declare indexed_columns cursor&lt;br /&gt;    for&lt;br /&gt;        select &lt;br /&gt;            c.name,&lt;br /&gt;            ic.is_descending_key&lt;br /&gt;        from&lt;br /&gt;                 sys.index_columns  ic&lt;br /&gt;            join sys.columns        c   on ic.column_id = c.column_id&lt;br /&gt;                                       and ic.object_id = c.object_id&lt;br /&gt;        where &lt;br /&gt;            ic.object_id = @object_id&lt;br /&gt;            and ic.index_id = @index_id&lt;br /&gt;            and ic.is_included_column = 0&lt;br /&gt;        order by &lt;br /&gt;            ic.index_column_id&lt;br /&gt;&lt;br /&gt;    open indexed_columns&lt;br /&gt;&lt;br /&gt;    fetch indexed_columns&lt;br /&gt;    into @indexed_column, @is_descending_key&lt;br /&gt;&lt;br /&gt;    while @@fetch_status&amp;lt;&amp;gt;(-1)&lt;br /&gt;    begin&lt;br /&gt;&lt;br /&gt;        set @indexed_columns = @indexed_columns + @indexed_column +&lt;br /&gt;                               case @is_descending_key when 1 then ' DESC ' else '' end + ', '&lt;br /&gt;&lt;br /&gt;        fetch indexed_columns&lt;br /&gt;        into @indexed_column, @is_descending_key&lt;br /&gt;&lt;br /&gt;    end&lt;br /&gt;&lt;br /&gt;    close indexed_columns&lt;br /&gt;    deallocate indexed_columns&lt;br /&gt;&lt;br /&gt;    set @indexed_columns = left(@indexed_columns, len(@indexed_columns)-1) + ')'&lt;br /&gt;&lt;br /&gt;    if exists&lt;br /&gt;           (select  object_id&lt;br /&gt;            from    sys.index_columns&lt;br /&gt;            where   object_id = @object_id&lt;br /&gt;                    and index_id = @index_id&lt;br /&gt;                    and is_included_column = 1 )&lt;br /&gt;    begin&lt;br /&gt;        set @included_columns = 'INCLUDE ('&lt;br /&gt;&lt;br /&gt;        declare included_columns cursor&lt;br /&gt;        for&lt;br /&gt;        select &lt;br /&gt;            c.name,&lt;br /&gt;            ic.is_descending_key&lt;br /&gt;        from&lt;br /&gt;                 sys.index_columns  ic&lt;br /&gt;            join sys.columns        c   on ic.column_id = c.column_id&lt;br /&gt;                                       and ic.object_id = c.object_id&lt;br /&gt;        where &lt;br /&gt;            ic.object_id = @object_id&lt;br /&gt;            and ic.index_id = @index_id&lt;br /&gt;            and ic.is_included_column = 1&lt;br /&gt;        order by &lt;br /&gt;            ic.index_column_id&lt;br /&gt;&lt;br /&gt;        open included_columns&lt;br /&gt;&lt;br /&gt;        fetch included_columns&lt;br /&gt;        into @included_column, @is_descending_key&lt;br /&gt;&lt;br /&gt;        while @@fetch_status&amp;lt;&amp;gt;(-1)&lt;br /&gt;        begin&lt;br /&gt;&lt;br /&gt;            set @included_columns = @included_columns + @included_column +&lt;br /&gt;                                    case @is_descending_key when 1 then ' DESC ' else '' end + ', '&lt;br /&gt;&lt;br /&gt;            fetch included_columns&lt;br /&gt;            into @included_column, @is_descending_key&lt;br /&gt;&lt;br /&gt;        end&lt;br /&gt;&lt;br /&gt;        close included_columns&lt;br /&gt;        deallocate included_columns&lt;br /&gt;&lt;br /&gt;        set @included_columns = left(@included_columns, len(@included_columns)-1) + ') ' &lt;br /&gt;&lt;br /&gt;    end&lt;br /&gt;&lt;br /&gt;    set @stmt = &lt;br /&gt;    'CREATE ' +  case @uniqueness when 1 then 'UNIQUE ' else '       ' end + case @type when 1 then 'CLUSTERED ' else '' end +&lt;br /&gt;    'INDEX ' + @index_name + ' ON ' + @schema_name + '.' + @table_name + @indexed_columns + ' ' + isnull(@included_columns,'') + @crlf &lt;br /&gt;    &lt;br /&gt;    set @included_columns = ''&lt;br /&gt;&lt;br /&gt;    print @stmt&lt;br /&gt;&lt;br /&gt;    fetch &lt;br /&gt;        indexes&lt;br /&gt;    into&lt;br /&gt;        @schema_name,&lt;br /&gt;        @table_name ,&lt;br /&gt;        @index_id   ,&lt;br /&gt;        @index_name ,&lt;br /&gt;        @type       ,&lt;br /&gt;        @uniqueness &lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;close indexes&lt;br /&gt;deallocate indexes&lt;/font&gt;&lt;br /&gt; &lt;img src="http://geekswithblogs.net/influent1/aggbug/148243.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alex Bransky</dc:creator>
            <guid>http://geekswithblogs.net/influent1/archive/2012/01/04/148243.aspx</guid>
            <pubDate>Wed, 04 Jan 2012 21:22:08 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/influent1/comments/148243.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/influent1/archive/2012/01/04/148243.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/influent1/comments/commentRss/148243.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/influent1/services/trackbacks/148243.aspx</trackback:ping>
        </item>
        <item>
            <title>annoying SSRS bug fix for building</title>
            <link>http://geekswithblogs.net/influent1/archive/2011/06/30/146037.aspx</link>
            <description>&lt;p&gt;If you're like me you've been using SSRS 2008 for a long time with TFS and have constantly had to delete the bin folder in order for builds to work.  This has irritated me to no end.  Well today is my lucky day!  There is a hotfix that actually fixes the bug!    Go here:  http://support.microsoft.com/kb/2438347&lt;/p&gt; &lt;img src="http://geekswithblogs.net/influent1/aggbug/146037.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alex Bransky</dc:creator>
            <guid>http://geekswithblogs.net/influent1/archive/2011/06/30/146037.aspx</guid>
            <pubDate>Thu, 30 Jun 2011 18:19:58 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/influent1/comments/146037.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/influent1/archive/2011/06/30/146037.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/influent1/comments/commentRss/146037.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/influent1/services/trackbacks/146037.aspx</trackback:ping>
        </item>
        <item>
            <title>indexes and deadlocks</title>
            <link>http://geekswithblogs.net/influent1/archive/2011/06/24/145971.aspx</link>
            <description>&lt;p&gt;I recently discovered that creating indexes in one of my production databases was causing deadlocks.  My problem was that I wasn't using ONLINE=ON when I was creating the index.  Check out the BOL for more information.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/influent1/aggbug/145971.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alex Bransky</dc:creator>
            <guid>http://geekswithblogs.net/influent1/archive/2011/06/24/145971.aspx</guid>
            <pubDate>Fri, 24 Jun 2011 18:27:03 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/influent1/comments/145971.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/influent1/archive/2011/06/24/145971.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/influent1/comments/commentRss/145971.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/influent1/services/trackbacks/145971.aspx</trackback:ping>
        </item>
        <item>
            <title>removing an ssrs instance from a scale-out deployment</title>
            <link>http://geekswithblogs.net/influent1/archive/2011/03/03/144173.aspx</link>
            <description>&lt;p&gt;If you're like me you had at one time connected one of your Reporting Services instances to a report server database that was already in use by another instance.  This allows the instance to show up in the Scale-out Deployment section of the Reporting Services Configuration Manager.  My problem was that the server that got joined to the original server was no longer available as it had been repurposed, and when I clicked Remove Server to remove it from my scale-out it would fail because it couldn't contact the server.  After searching for a solution for quite some time I decided to look around in the report server database tables, and voila!  All I had to do was remove the old server from the Keys table.  I can't guarantee there won't be any side effects to this method, but it worked like a charm for me. &lt;/p&gt; &lt;img src="http://geekswithblogs.net/influent1/aggbug/144173.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alex Bransky</dc:creator>
            <guid>http://geekswithblogs.net/influent1/archive/2011/03/03/144173.aspx</guid>
            <pubDate>Thu, 03 Mar 2011 19:49:30 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/influent1/comments/144173.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/influent1/archive/2011/03/03/144173.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/influent1/comments/commentRss/144173.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/influent1/services/trackbacks/144173.aspx</trackback:ping>
        </item>
        <item>
            <title>migrating sharepoint databases</title>
            <link>http://geekswithblogs.net/influent1/archive/2011/02/16/143970.aspx</link>
            <description>&lt;p&gt;If you're wondering how to migrate your SharePoint databases to a new server, this Microsoft article is actually pretty useful, though still overly complex like most of their other articles.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc512725.aspx"&gt;http://technet.microsoft.com/en-us/library/cc512725.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The one thing I would change is that they &lt;a href="http://technet.microsoft.com/en-us/library/cc512725.aspx#Alias"&gt;seem to recommend installing SQL Server Configuration Manager on web servers&lt;/a&gt;, when all that was needed in my case was to add an entry to the hosts file on the SharePoint web server that used the IP address of the new SQL Server with the name of the old SQL Server.  This might not be appropriate in cases where the old server is not being decommissioned.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/influent1/aggbug/143970.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alex Bransky</dc:creator>
            <guid>http://geekswithblogs.net/influent1/archive/2011/02/16/143970.aspx</guid>
            <pubDate>Wed, 16 Feb 2011 22:55:44 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/influent1/comments/143970.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/influent1/archive/2011/02/16/143970.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/influent1/comments/commentRss/143970.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/influent1/services/trackbacks/143970.aspx</trackback:ping>
        </item>
        <item>
            <title>workspaces in sql mgmt studio</title>
            <link>http://geekswithblogs.net/influent1/archive/2009/07/01/133188.aspx</link>
            <description>How is it that you still can't save workspaces in SQL Server Management Studio as of version 2008?  It seems like such a simple thing to implement.  Quite often I create a bunch of different queries during a short period that are specific to a task I'm working on and that won't be needed once the task is completed, and rather than having to save each one it would be nice if I could just save a workspace file that knows which queries were open. &lt;img src="http://geekswithblogs.net/influent1/aggbug/133188.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alex Bransky</dc:creator>
            <guid>http://geekswithblogs.net/influent1/archive/2009/07/01/133188.aspx</guid>
            <pubDate>Wed, 01 Jul 2009 22:46:09 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/influent1/comments/133188.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/influent1/archive/2009/07/01/133188.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/influent1/comments/commentRss/133188.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/influent1/services/trackbacks/133188.aspx</trackback:ping>
        </item>
        <item>
            <title>attaching adventureworks2008 on full version of sql server</title>
            <link>http://geekswithblogs.net/influent1/archive/2009/06/09/132711.aspx</link>
            <description>For anybody that bought the &lt;a href="javascript:void(0);/*1244568976441*/"&gt;SQL Server 2008 Self-Paced Training book for 70-433&lt;/a&gt;, if you are running a full version of SQL Server 2008 rather than the express edition, you will have problems attaching the AdventureWorks2008 database (file activation error).  The trick is to use a SQL command, like so:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
USE [master]&lt;br /&gt;
GO&lt;br /&gt;
CREATE DATABASE [AdventureWorks2008] ON &lt;br /&gt;
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\AdventureWorks2008_Data.mdf' ),&lt;br /&gt;
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\AdventureWorks2008_Log.ldf' ),&lt;br /&gt;
 FILEGROUP Documents CONTAINS FILESTREAM (NAME = Documents, FILENAME=N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\Documents')&lt;br /&gt;
 FOR ATTACH&lt;br /&gt;
GO &lt;img src="http://geekswithblogs.net/influent1/aggbug/132711.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alex Bransky</dc:creator>
            <guid>http://geekswithblogs.net/influent1/archive/2009/06/09/132711.aspx</guid>
            <pubDate>Wed, 10 Jun 2009 00:39:05 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/influent1/comments/132711.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/influent1/archive/2009/06/09/132711.aspx#feedback</comments>
            <slash:comments>15</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/influent1/comments/commentRss/132711.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/influent1/services/trackbacks/132711.aspx</trackback:ping>
        </item>
        <item>
            <title>tinyint surprise</title>
            <link>http://geekswithblogs.net/influent1/archive/2009/02/10/129319.aspx</link>
            <description>I just discovered something rather surprising.  If you return a tinyint from a stored procedure as part of a dataset, and bind that dataset to a dataview, and then do something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;&amp;lt;asp:Label runat="server" id="statusLabel" Text='&amp;lt;%# GetStatusText( (int)DataBinder.Eval(Container, "DataItem.status")) %&amp;gt;'&amp;gt;&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;
&lt;span style="font-weight: bold;"&gt;&amp;lt;/asp:Label&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
You will get an error about an invalid cast.  If the stored procedure returns an int instead of tinyint, it works just fine.  How can ASP.Net 3.5 not be able to cast from a tinyint (or whatever its C# equivalent is) to an int?? &lt;img src="http://geekswithblogs.net/influent1/aggbug/129319.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alex Bransky</dc:creator>
            <guid>http://geekswithblogs.net/influent1/archive/2009/02/10/129319.aspx</guid>
            <pubDate>Wed, 11 Feb 2009 01:05:03 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/influent1/comments/129319.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/influent1/archive/2009/02/10/129319.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/influent1/comments/commentRss/129319.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/influent1/services/trackbacks/129319.aspx</trackback:ping>
        </item>
        <item>
            <title>activerecord and executereader exceptions</title>
            <link>http://geekswithblogs.net/influent1/archive/2008/05/28/122460.aspx</link>
            <description>&lt;p&gt;About once a day I was getting the following error from an ASP.Net web page that uses ActiveRecord:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Exception Details: &lt;/strong&gt;System.Data.SqlClient.SqlException: A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)&lt;/p&gt;
&lt;p&gt;I would subsequently get this error upon refreshing the page:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Exception Details: &lt;/strong&gt;System.InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is closed.&lt;/p&gt;
&lt;p&gt;I finally figured out that the problem occurs when the database is restored.  The connections in the IIS application pool do not get destroyed when the database is restored, so when ActiveRecord (nHibernate) tries to reuse the connections it fails.  This doesn't happen to me when I'm not using ActiveRecord, so I'm not sure if this is a bug with ActiveRecord or a problem with the way I've set up the data access layer.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/influent1/aggbug/122460.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alex Bransky</dc:creator>
            <guid>http://geekswithblogs.net/influent1/archive/2008/05/28/122460.aspx</guid>
            <pubDate>Wed, 28 May 2008 20:46:45 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/influent1/comments/122460.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/influent1/archive/2008/05/28/122460.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/influent1/comments/commentRss/122460.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/influent1/services/trackbacks/122460.aspx</trackback:ping>
        </item>
        <item>
            <title>ssas: define reference and materialize</title>
            <link>http://geekswithblogs.net/influent1/archive/2008/04/10/121176.aspx</link>
            <description>&lt;p&gt;Apparently you have to watch out when you select Materialize in a referenced dimension in SSAS 2005.  I just ran into a situation where data was getting duplicated for no good reason, and unchecking Materialize fixed it.&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;http://www.biblogs.com/2006/12/23/materialize-option-in-a-reference-dimension/&lt;/font&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/influent1/aggbug/121176.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alex Bransky</dc:creator>
            <guid>http://geekswithblogs.net/influent1/archive/2008/04/10/121176.aspx</guid>
            <pubDate>Thu, 10 Apr 2008 22:25:34 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/influent1/comments/121176.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/influent1/archive/2008/04/10/121176.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/influent1/comments/commentRss/121176.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/influent1/services/trackbacks/121176.aspx</trackback:ping>
        </item>
    </channel>
</rss>
