USE master;GODECLARE @SQL VARCHAR(MAX);SET @SQL=''SELECT @SQL=@SQL+'; KILL '+RTRIM(SPID)FROM sysprocesses WHERE dbid=DB_ID('MobileDB3.1');EXEC(@SQL);GO ALTER DATABASE [MobileDB3.1] SET MULTI_USER;