好记性不如烂笔头。

备份导出数据库表字段说明信息到可执行脚本

SELECT 'EXECUTE sp_updateextendedproperty N''MS_Description'', N'''+CONVERT(NVARCHAR(100), sys.extended_properties.[value])+''', N''SCHEMA'', N''dbo'', N''TABLE'', N'''+sysobjects.name+''', N''COLUMN'', N'''+syscolumns.name+'''' AS Sql FROM sys.extended_properties RIGHT OUTER JOIN sysobjects INNER JOIN syscolumns ON sysobjects.id = syscolumns.id INNER JOIN systypes ON syscolumns.xtype = systypes.xtype ON sys.extended_properties.major_id = syscolumns.id AND sys.extended_properties.minor_id = syscolumns.colid WHERE (sysobjects.xtype = 'u' OR sysobjects.xtype = 'v') AND (systypes.name <> 'sysname') AND sys.extended_properties.minor_id IS NOT NULL