Remove Windows User (edit)
Windows 10
- Start > Run > control userpasswords2
- Delete all databases
Script delete all databases
https://stackoverflow.com/questions/5777483/drop-all-databases-from-server
EXEC sp_MSforeachdb '
IF DB_ID(''?'') > 4
BEGIN
EXEC(''
ALTER DATABASE [?] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DROP DATABASE [?]
'')
END'
Script delete all databases
DECLARE @command nvarchar(max)
SET @command = ''
SELECT @command = @command
+ 'ALTER DATABASE [' + [name] + '] SET single_user with rollback immediate;'+CHAR(13)+CHAR(10)
+ 'DROP DATABASE [' + [name] +'];'+CHAR(13)+CHAR(10)
FROM [master].[sys].[databases]
where [name] not in ( 'master', 'model', 'msdb', 'tempdb');
SELECT @command
EXECUTE sp_executesql @command