IF DB_NAME() IS NULL
Begin
	print 'Kein Connect zur Datenbank'
end
else
	begin
	print 'Datenbank-Connect Ok'
	Declare @DBNAME varchar(50), @CMD varchar(255)
	set  @DBNAME=DB_NAME()
	if (select DATABASEPROPERTYEX(@DBNAME,'RECOVERY')) <> 'SIMPLE'
	begin
	set @CMD='ALTER DATABASE ' + @DBNAME + ' SET RECOVERY SIMPLE'
	exec(@CMD)
	print 'Change Recovery-Mode to Simple !!!'
	end
end



