ALTER procedure sp_columnscript
@tablename varchar(50),
@columnname varchar(50) = null
as
/*****************************
修改日期:2003-04-09
修改人:wu
备注:取得某个表的备注:
*****************************/
declare @tmpPos int
if @columnname is null
begin
set @tmpPos = CHARINDEX('.', @tablename)
set @columnname = right(@tablename, len(@tablename) - @tmpPos)
set @tablename = left(@tablename, @tmpPos - 1)
end
select * from ::fn_listextendedproperty(null, 'user', 'dbo', 'table', @tablename, 'column', @columnname)
建了这个存储过程之后,在工具,自定义里增加对应的快捷键,比如在Ctrl+3里指定sp_columnscript
然后在查询分析器里选择 table.column 选中这段文字后,按Ctrl + 3就可以了