|
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 |