Olá,
Boa tarde!
A mensagem 5011 é
Msg 5011, Level 14, State 5, Line 1
User does not have permission to alter database DB1', the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Pelo texto da mensagem, você conferiu se o nome do database está correto? Seu usuário tem permissão para executar esse comando ?
Tente executar o comando select IS_SRVROLEMEMBER('sysadmin') e me fale se retornou 0 ou 1