how do I change schema owner in ms sql server?

Peter picture Peter · Apr 22, 2015 · Viewed 15k times · Source

I currently have a website hosted developed with kentico 7. I tried importing the exported website into my localhost and that failed. In my findings, i realised that each table in the online version has a bvs (the database user created) prefix. I have tried creating the same scenario on my localhost without any luck. Does anyone have an idea ?

Here is the error displayed at importation.

enter image description here

Answer

FutbolFan picture FutbolFan · Apr 22, 2015

Try this out:

USE MyDB
GO
ALTER AUTHORIZATION ON SCHEMA::bvs TO dbo;
GO 
SP_DROPUSER 'bvs'
GO
SP_CHANGEDBOWNER 'bvs'