Thursday, 16 June 2011

Works in SQL Server 2000 and 2008, fails in 2005

The following may fail in SQL 2005 but works in 2000 and 2008 with an error message Lock request time out period exceeded


ALTER DATABASE [MyDb] SET MULTI_USER WITH ROLLBACK IMMEDIATE;
GO

The workaround?

ALTER DATABASE [MyDb] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO
ALTER DATABASE [MyDb] SET MULTI_USER WITH ROLLBACK IMMEDIATE;
GO

looks like it is a known issue in SQL Server 2005. TODO: dig a link to KB article

No comments:

Post a Comment