中青给的一个存储过程,目前我还没看懂

USE [WFITWeb]
GO
/****** Object:  StoredProcedure [dbo].[sp_objitems]    Script Date: 01/03/2013 10:59:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[sp_objitems] 
 @table_name varchar(50) 
as 
Select c.column_id, c.name colname, p.value remark, t.name typename, c.max_length 
from sys.columns c 
inner join sys.objects o on o.object_id=c.object_id and o.type='U' and o.name=@table_name  
left join sys.extended_properties p on p.major_id=o.object_id and p.minor_id=c.column_id 
left join sys.types t on t.User_type_id=c.User_type_id 

posted @ 2013-01-03 11:01  洗耳恭听兼烂笔头  阅读(130)  评论(0编辑  收藏  举报