jueves, 24 de febrero de 2011

¿Cómo cambiar el schema por defecto en SQL2005?

ALTER USER (Transact-SQL)
Renames a database user or changes its default schema.
Syntax

ALTER USER userName
WITH [ ,...n ]
::=
NAME =newUserName
DEFAULT_SCHEMA =schemaName
LOGIN =loginName
Arguments

Important
The value of DEFAULT_SCHEMA is ignored if the user is a member of the sysadmin fixed server role. All members of the sysadmin fixed server role have a default schema of dbo.
You can change the name of a user who is mapped to a Windows login or group only when the SID of the new user name matches the SID that is recorded in the database. This check helps prevent spoofing of Windows logins in the database.

EJEMPLO DE USO:

ALTER USER sysadm WITH DEFAULT_SCHEMA=sysadm

Fuente: http://msdn.microsoft.com/en-us/library/ms176060.aspx

No hay comentarios:

Publicar un comentario