Как поменять владельца таблицы у MS SQL? #141393


#0 by neomarat
Знаю, что есть команда, но не знаю какая. Спасибо
#1 by ГламурныйПодонок
sp_changedbowner [ @loginame = ] 'login'    [ , [ @map = ] remap_alias_flag ] Arguments [@loginame =] 'login' Is the login ID of the new owner of the current database. login is sysname, with no default. login must be an already existing Microsoft® SQL Server™ login or Microsoft Windows NT® user. login cannot become the owner of the current database if it already has access to the database through an existing alias or user security account within the database. To avoid this, drop the alias or user within the current database first. [@map =] remap_alias_flag Is the value true or false, which indicates whether existing aliases to the old database owner (dbo) are mapped to the new owner of the current database or dropped. remap_alias_flag is varchar, with a default of NULL, indicating that any existing aliases to the old dbo are mapped to the new owner of the current database. false indicates that existing aliases to the old database owner are dropped.
#2 by Билли Г
Если надо сменить владельца всё-таки таблицы, а не всей базы, то так: exec sp_changeobjectowner 'mytable', 'newoЕсли'
#3 by ГламурныйПодонок
Натюрлих. Промахнулся.
Тэги:
Ответить:
Комментарии доступны только авторизированным пользователям

В этой группе 1С