2009年4月25日 星期六

顯示 SQL 欄位內容

Select sysobjects.name As TableName, syscolumns.name As ColName, systypes.name As ColType, syscolumns.length As ColLen, syscomments.text As ColDef, Cast(sysproperties.[value] As nvarchar) As ColDesc From sysobjects Left Outer Join syscolumns on sysobjects.id = syscolumns.id Left Outer Join sysproperties On syscolumns.colid = sysproperties.smallid Left Outer Join systypes On syscolumns.xtype = systypes.xtype Left Outer Join syscomments On syscolumns.cdefault = syscomments.id Where (sysobjects.name = N'資料表名稱') Order By syscolumns.colorder

沒有留言:

張貼留言