It turns out that in SQL these databases :
SP2013_SecureStore
SP2013_Profile
SP2013_Sync
SP2013_Social
are owned by the farm account (sp_farm) whereas the rest of the databases are owned by the setup account (in my case sp_admin). This explains why the command throws the error. Not sure why these databases are owned by the sp_farm account. Thoughts anyone?
SP2013_SecureStore
SP2013_Profile
SP2013_Sync
SP2013_Social
are owned by the farm account (sp_farm) whereas the rest of the databases are owned by the setup account (in my case sp_admin). This explains why the command throws the error. Not sure why these databases are owned by the sp_farm account. Thoughts anyone?