sp_checknames [help | silent]
help
显示有关扫描的系统表的信息。
silent
在无提示模式下检查当前数据库,返回下列值之一:
0 – 如果不存在包含 7 位 ASCII 字符之外字符的名称
1 – 如果至少存在一个包含 7 位 ASCII 字符之外字符的名称
.
检查 master 数据库中是否存在包含 7 位 ASCII 字符集以外字符的名称。
sp_checknames
Looking for non 7-bit ASCII characters in the system tables of database:
"master"
===============================================================
Table.Column name: "syslogins.password"
The following logins have passwords that contain non 7-bit
ASCII characters. If you wish to change them use "sp_password";
Remember, only the sa and the login itself may examine or change
the syslogins.password column:
suid name
------ ------------------------------
1 sa
2 probe
3 bogususer
显示有关扫描的系统表的信息:
1> sp_checknames help
2> go
sp_checknames is used to search for non 7-bit ASCII characters
several important columns of system tables. The following
columns are searched:
In "master":
sysdatabases.name
sysdevices.name
syslogins.name
syslogins.dbname
syslogins.password
sysremotelogins.remoteusername
sysservers.srvname
sysservers.srvnetname
In all databases:
syscolumns.name
sysindexes.name
sysobjects.name
syssegments.name
systypes.name
sysusers.name
(return status = 0)
1>
禁止输出系统表名称,只显示返回状态:
1> sp_checknames silent
2> go
(return status = 1)
使用 sp_checknames 时,还存在一些其它注意事项:
sp_checknames 检查当前数据库中的所有对象、列、索引、用户名、组名和其它元素的名称中是否包含 7 位 ASCII 字符集以外的字符。它将报告非法名称并提供使这些名称与 7 位 ASCII 字符集兼容的说明。
当从 SQL Server 版本 4.0.x 或 4.2.x 升级后或使用非 7 位 ASCII 的缺省字符集后,应该在服务器上的每个数据库中运行 sp_checknames。
根据 sp_checknames 报告中的说明更正所有非 ASCII 名称。