AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX: Администрирование
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 01.06.2005, 17:30   #1  
tolstjak is offline
tolstjak
Участник
 
440 / 16 (1) ++
Регистрация: 05.01.2003
Изменение владельца (owner) представления (view) в SQL
Здравствуйте уважаемые знатоки.

Как можно изменить владельца представлений в SQL.
На таблицы знаю, на представления нет.

Заранее благодарен.
__________________
Александр
Старый 01.06.2005, 17:54   #2  
slava is offline
slava
сибиряк
Самостоятельные клиенты AX
 
468 / 23 (1) +++
Регистрация: 28.12.2001
Адрес: Москва
Re: Изменение владельца (owner) представления (view) в SQL
Цитата:
Изначально опубликовано tolstjak
На таблицы знаю, на представления нет.
Можно через EM, design view ...
Или надо из кода?
__________________
С уважением, Вячеслав.
Старый 02.06.2005, 00:33   #3  
sukhanchik is offline
sukhanchik
Administrator
Аватар для sukhanchik
MCBMSS
Злыдни
Лучший по профессии 2015
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
Лучший по профессии 2009
 
3,289 / 3495 (123) ++++++++++
Регистрация: 13.06.2004
Адрес: Москва
смотрим Books Online...
sp_changeobjectowner [ @objname = ] 'object' , [ @newowner = ] 'owner'

Arguments
[@objname =] 'object'

Is the name of an existing table, view, or stored procedure in the current database. object is nvarchar(517), with no default. object can be qualified with the existing object owner, in the form existing_owner.object.

[@newowner =] 'owner'

Is the name of the security account that will be the new owner of the object. owner is sysname, with no default. owner must be a valid Microsoft® SQL Server™ user or role, or Microsoft Windows NT® user or group in the current database. When specifying Windows NT users or groups, specify the name the Windows NT user or group is known by in the database (added using sp_grantdbaccess).

Return Code Values
0 (success) or 1 (failure)

Remarks
The owner of an object (or the members of the group or role owning the object) has special permissions for the object. Object owners can execute any of the Transact-SQL statements related to the object (for example, INSERT, UPDATE, DELETE, SELECT, or EXECUTE) and can also manage the permissions for the object.

Use sp_changeobjectowner to change the owner of an object if the security account that owns the object has to be dropped but the object must be retained. This procedure removes all existing permissions from the object. You will need to reapply any permissions you want to keep after running sp_changeobjectowner.

For this reason, it is recommended that you script out existing permissions before running sp_changeobjectowner. Once ownership of the object has been changed, you may use the script to reapply permissions. You will need to modify the object owner in the permissions script before running. For more information about database scripting, see Documenting and Scripting Databases.

Use sp_changedbowner to change the owner of a database.

Permissions
Only members of sysadmin fixed server role, the db_owner fixed database role, or a member of both the db_ddladmin and db_securityadmin fixed database roles can execute sp_changeobjectowner.

Examples
This example changes the owner of the authors table to Corporate\GeorgeW.

EXEC sp_changeobjectowner 'authors', 'Corporate\GeorgeW'
Старый 02.06.2005, 11:52   #4  
tolstjak is offline
tolstjak
Участник
 
440 / 16 (1) ++
Регистрация: 05.01.2003
Все получилось. Огромное спасибо.

НАШИ ПОБЕДИЛИ !
__________________
Александр
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Dynamics AX: SQL Server, Heart of Dynamics AX Blog bot DAX Blogs 0 13.07.2007 18:00
Доступ к VIEW SQL SERVER из Axapta 111andrei DAX: Программирование 13 02.12.2005 11:19
Как реализовать Query или View на примере такого T-SQL запроса для OLAP? sao DAX: Программирование 9 07.10.2005 18:57
View & SQL Tays DAX: Программирование 22 07.07.2005 11:20
Изменение Relation у View Paul_ST DAX: Программирование 3 14.12.2004 06:51

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 21:43.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.