设为首页 加入收藏

TOP

Sybase查询表结构的方法(类似于Oracle的Desc)(六)
2015-07-24 11:22:52 来源: 作者: 【 】 浏览:18
Tags:Sybase 查询表 结构 方法 类似 Oracle Desc
re encrypted columns that have decrypt default values */ if exists (select * from #helptype where Decrypt_Default_name is not null) begin select @sqltext = @sqltext + ", Decrypt_Default_name" end /* ** Display Lob compression level only if there are compressed LOB ** columns. */ if exists (select * from #helptype where Lob_compression_level is not null) begin select @sqltext = @sqltext + ", Lob_compression_level" end /* ** Display the varbinary truncation only if there ** is any varbinary column. */ if exists (select * from #helptype where Type = "varbinary" or (Type = "binary" and Nulls = 1)) begin select @sqltext = @sqltext + ", Varbinary_is_truncated" /* Update the field non-varbinary types */ update #helptype set Varbinary_is_truncated = NULL where (Type != "varbinary" and (Type != "binary" or Nulls = 0)) or Computed_Column_object is not null end exec sp_autoformat @fulltabname = #helptype, @selectlist = @sqltext, @orderby = "order by Col_order asc" drop table #helptype end /* ** If this is a table object that has computed columns, display the ** computed column information. */ if (@sysstat & 15) in (1, 3) begin if exists (select 1 from syscolumns where id = object_id(@objname) and computedcol is not null and (status3 & 1) !=1) begin print "" execute dbo.sp_helpcomputedcolumn @objname, 0 end end /* ** For procedures and sqlj functions, the parameters of the procedures ** are stored in syscolumns. */ if @sysstat & 15 in (4, 10, 12) begin exec sp_help_params @objname end /* ** If the object is an external table, show which OS file it's using. */ if @sysstat & 2063 = 2051 begin select @OS_file = name from sysindexes where id = object_id(@objname) and indid in (0,1) /* ** 17570, "Operating System File" ** 17571, "---------------------" */ print "" exec sp_getmessage 17570, @msg out print @msg exec sp_getmessage 17571, @msg out print @msg print @OS_file print "" end /* ** If the object is an Omni-managed table, show its storage location. */ if (@sysstat2 & 1024 = 1024) begin declare @dbname varchar(255), @site varchar(255), @owner varchar(255), @tabname varchar(255), @retcode int exec @retcode = sp_namecrack @objname, @site output, @dbname output, @owner output, @tabname output select @OS_file = char_value from sysattributes where class = 9 and attribute = 1 and object_cinfo = @tabname /* ** 17573, "Object is Remote/External" ** 17574, "-------------------------" */ print "" exec sp_getmessage 17573, @msg out print @msg exec sp_getmessage 17574, @msg out print @msg print @OS_file print "" if (@sysstat2 & 2048 = 2048) begin /* ** 17575, "Object existed prior to Omni" */ exec sp_getmessage 17575, @msg out print @msg print "" end end /* ** If the object is a table, display sysattributes information ** if there is any. It could be in the current database under ** type "T". */ if @sysstat & 15 in (1, 3) begin /* Create temporary table for sysattributes data */ create table #sphelpattr ( class varchar(255), class_id smallint, attribute varchar(255), attribute_id smallint, int_value int NULL, char_value varchar(255) NULL, comments varchar(255) NULL ) /* ** The join with master..sysattributes here is to ** get the string descriptions for the class and attribute. ** Thes
首页 上一页 3 4 5 6 7 8 9 下一页 尾页 6/9/9
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇先打11.2.0.3.8这个PSU,后建库 下一篇oracle巡检脚本-部分

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·你必须要弄懂的多线 (2025-12-25 04:22:35)
·如何在 Java 中实现 (2025-12-25 04:22:32)
·Java【多线程】单例 (2025-12-25 04:22:29)
·C++中智能指针的性能 (2025-12-25 03:49:29)
·如何用智能指针实现c (2025-12-25 03:49:27)