• From Karl Shifflett: The WPF & Silverlight Designer Team (Cider Team) has just launched a new team blog at http://blogs.msdn.com/wpfsldesigner/default.aspx

  • Link for SQL Server 2008 Top New Features.

  • SQL training videos from SQLShare site that includes videos on SSIS.  Click on links in Tags section to bring up videos by tag name/topics.
     
  • I wanted to change the name of an Microsoft SQL Database, but was unable to due to the inability to get exclusive control of the database.  Below is a query I found on Will Strohl's blog on how to kill processes/sessions on SQL Server for a particular database.  After running the query and killing the processes/sessions that where preventing me from gaining exclusive control of the database, I was able to rename my database.  Thanks Will!

DECLARE @Database NVARCHAR(150);
-- change this to be the name of your database that you want to kill processes/sessions for SELECT @Database = 'MyDatabaseName';
Select @Database = 'MyDatabaseName';
CREATE TABLE #tempProcesses(
 [spid] [int] NOT NULL,
 [ecid] [int] NOT NULL,
 [status] [nvarchar](150) NOT NULL,
 [loginname] [nvarchar](150) NOT NULL,
 [hostname] [nvarchar](150) NULL,
 [blk] [int] NOT NULL,
 [dbname] [nvarchar](150) NULL,
 [cmd] [nvarchar](150) NOT NULL,
 [request_id] [int] NOT NULL);

INSERT INTO #tempProcesses EXEC sp_who;

CREATE TABLE #tempProcesses2([spid] [int] NOT NULL);

INSERT INTO #tempProcesses2
SELECT [spid] FROM #tempProcesses
WHERE [dbname] = @Database;

DROP TABLE #tempProcesses;

DECLARE @ProcessId INT;
DECLARE [cursorProcess] CURSOR FOR SELECT [spid] FROM #tempProcesses2

OPEN [cursorProcess]
FETCH NEXT FROM [cursorProcess] INTO @ProcessId
WHILE @@FETCH_STATUS = 0
BEGIN EXEC('KILL ' + @ProcessId);
FETCH NEXT FROM [cursorProcess] INTO @ProcessId
END

DROP TABLE #tempProcesses2;

CLOSE [cursorProcess];
DEALLOCATE [cursorProcess];