In my case, it was a permissions issue.
For the Windows user, I was using did not have dbcreator
role.
So I followed the below steps
sa
to the SQL serverSecurity
in Object ExplorerLogins
Server Roles
from Select a page
optionsdbcreator
role for the user