To change user names, login names, device names, remote server names, remote server user names, segment names, and character set and language names, first determine if you can drop the object or user, then add or create it again. If you cannot do that, use the following command to allow direct updates to system tables:
sp_configure "allow updates to system tables", 1
Only a system security officer can set the allow updates to system tables configuration parameter.
Errors during direct updates to system tables can create severe problems in the SAP ASE server. Determine whether you can drop the objects or user, then re-create them:
Identifier Type |
Suggested Actions to Avoid Updates to System Tables |
---|---|
User names and login names |
To change the name of a user with no objects:
|
Device names |
If this device is completely allocated, you need not use its name in a create database command, so you can leave the name unchanged. |
Remote server names |
Unless there are large numbers of remote login names from the remote server, drop the remote server (sp_dropserver) and add it with a new name (sp_addserver). |
Remote server logins |
Drop the remote login with sp_dropremotelogin, add it with a new name using sp_addremotelogin, and restore the user’s permission to execute procedures with grant. |
Segment names |
These are rarely used, once objects have been created on the segments. |
Character set and language names |
Languages and character sets have reserved words as identifiers only if a system administrator has created alternative languages with sp_addlanguage. Drop the language with sp_droplanguage, and add it with a new name. |
This table shows possible dependencies on this set of identifiers. See this table for possible dependencies, whether you choose to upgrade by dropping and re-creating objects, by using delimited identifiers, or by performing direct updates to system tables.
Identifier |
Remember To |
---|---|
Login name |
Change the user name in each database where this person is a user. |
User name |
Drop, edit, and re-create all procedures, triggers, and views that use qualified (owner_name.object_name) references to objects owned by this user. Change all applications and SQL source scripts that use qualified object names to use the new user name. You do not have to drop the objects themselves; sysusers is linked to sysobjects by the column that stores the user’s ID, not the user’s name. |
Device name |
Change any SQL source scripts or applications that reference the device name to use the new name. |
Remote server name |
Change the name on the remote server. If the name that sp_checkreswords reports is the name of the local server, you must restart the server before you can issue or receive remote procedure calls. |
Remote server network name |
Change the server’s name in the interfaces files. |
Remote server login name |
Change the name on the remote server. |
Segment name |
Drop and re-create all procedures that create tables or indexes on the segment name. Change all applications that create objects on segments to use the new segment name. |
Character set name |
None. |
Language name |
Change both master.dbo.syslanguages and master.dbo.syslogins. The update to syslogins may involve many rows. Also, change the names of your localization files. |
sp_configure "allow updates to system tables", 1
begin transaction update sysusers set name = "workerbee" where name = "work"
Only the correct row – use commit transaction.
More than one row or the incorrect row – use rollback transaction, determine the source of the problem, and execute the command correctly.
sp_configure "allow updates to system tables", 0
select db_name()
Type of identifier |
Table to update |
Column name |
---|---|---|
User name |
sysusers |
name |
Login names |
master.dbo.syslogins |
name |
Segment names |
syssegments |
name |
Device name |
sysdevices |
name |
Remote server name |
sysservers |
srvname |
Remote server network name |
sysservers |
srvnetname |
Character set names |
master.dbo.syscharsets |
name |
Language name |
master.dbo.syslanguages master.dbo.syslogins |
name language |