 --1.给表中字段添加描述信息
--1.给表中字段添加描述信息
 CREATE   table T2 (id int , name char (20))
CREATE   table T2 (id int , name char (20))
 GO
GO
 EXEC   sp_addextendedproperty 'MS_Description', 'Employee ID', 'user', dbo, 'table', T2, 'column', id
EXEC   sp_addextendedproperty 'MS_Description', 'Employee ID', 'user', dbo, 'table', T2, 'column', id

 EXEC   sp_updateextendedproperty 'MS_Description', 'this is a test', 'user', dbo, 'table', T2, 'column', id
EXEC   sp_updateextendedproperty 'MS_Description', 'this is a test', 'user', dbo, 'table', T2, 'column', id

 --2.修改数据库名称
--2.修改数据库名称
 EXEC sp_renamedb 'old_db_name', 'new_db_name'
EXEC sp_renamedb 'old_db_name', 'new_db_name'

 --3.修改数据表名称和字段名称
--3.修改数据表名称和字段名称
 EXEC sp_rename 'old_table_name', 'new_table_name'--修改数据表名称
EXEC sp_rename 'old_table_name', 'new_table_name'--修改数据表名称
 EXEC sp_rename 'table_name.[old_column_name]', 'new_column_name', 'COLUMN'--修改字段名称
EXEC sp_rename 'table_name.[old_column_name]', 'new_column_name', 'COLUMN'--修改字段名称 
		 
		posted @ 
2006-01-15 02:14 
jhtchina 
阅读(
327) 
评论() 
 
收藏 
举报