14. august 2006 - 10:27Der er
12 kommentarer og 1 løsning
Ændre tabel ejer
Hejsa,
Det er sådan at jeg har lagt min SQL database op på på mit web hotel, problemet er bare at nu kan jeg ikke længere se de tabeler der hedder dbo.xxxx, hvordan ændre jeg det dbo til fx. brian, sådan at jeg blot skal trykke eksportere og så virker det ?
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.
Use sp_changedbowner to change the owner of a database.
Permissions Only members of 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.
Du kan eventuelt automatisere proceduren lidt ved at lave et script som kigger i sysobjects tabellen. Jeg mener at kolonnen uid viser object owner, og her kan du så søge ud de tabeller, views m.m. som har en forkert ejer/owner.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.