I am trying to execute a database script I created through the Forward Engineer Addin for Microsoft Visio. Initially, when I executed the first time on Microsoft SQL Server Management Studio, it executed. However, when I changed the diagram in Visio, created a new script and re-executed the script, I received the following errors:
Msg 5011: User does not have permission to alter database
Msg 5069: ALTER DATABASE statement failed
Msg 3701: Cannot drop the database because it does not exist or you do not have permission.
It ran the first time I executed. I did not change any settings prior to attempting to re-execute the script. But why am I receiving the aforementioned errors?
How do I ensure the user using to execute the script has access to modify database properties and create database permissions?
You will need to make sure the user you are using to execute the script has access to modify database properties and create database permissions.