|
*/
select attribute_class =
convert(varchar(512), c.char_value),
attribute = convert(varchar(512), a.char_value),
t.int_value,
char_value = convert(varchar(512), t.char_value),
t.comments
into #sphelp6rs
from sysattributes t, master.dbo.sysattributes c,
master.dbo.sysattributes a
where t.object_type = "P"
and t.object = object_id(@objname)
and c.class = 0 and c.attribute = 0
and a.class = 0 and a.attribute = 1
and t.class = c.object
and t.class = a.object
and t.attribute = a.object_info1
exec sp_autoformat @fulltabname = #sphelp6rs
drop table #sphelp6rs
end
end
/*
** If the object is a table, check out the indexes.
*/
if @sysstat & 15 in (1, 3)
execute dbo.sp_helpindex @objname
/*
** If the object is a table or view, check out the keys.
*/
if @sysstat & 15 in (1, 2, 3)
execute dbo.sp_helpkey @objname
/*
** If the object is a table, check out the slices/partitions
*/
if @sysstat & 15 in (1, 3)
execute dbo.sp_helpartition @objname
/*
** If the object is a trigger, it is either enabled or disabled
*/
if @sysstat & 15 in (0,8)
begin
/*
** 1048676 <==> 0x100000 <==> insert trigger disabled
** 2097152 <==> 0x200000 <==> delete trigger disabled
** 4194304 <==> 0x400000 <==> update trigger disabled
*/
if exists (select 1 from sysobjects trig, sysobjects tab
where trig.id = object_id(@objname)
and trig.deltrig = tab.id
and ((trig.id = tab.deltrig and tab.sysstat2 & 2097152 <> 0)
or (trig.id = tab.updtrig and tab.sysstat2 & 4194304 <> 0)
or (trig.id = tab.instrig and tab.sysstat2 & 1048576 <> 0)))
exec sp_getmessage 17581, @msg out
else
exec sp_getmessage 17582, @msg out
print @msg
end
/*
** If the object is a table, display the table level LOB compression level
*/
if @sysstat & 15 in (1, 3)
begin
select @tab_lob_cmplvl = lobcomp_lvl
from sysobjects
where id = object_id(@objname)
select @msg = "Table LOB compression level " + convert(varchar(3), @tab_lob_cmplvl)
print @msg
if exists (select 1 from sysattributes
where object_type="TI" and object_info1 & 4096 = 4096
and object = object_id(@objname))
begin
select @msg = "Table " + @objname + " has columns dropped by no datacopy method."
print @msg
end
end
/*
** Print the lock scheme information for the table objects
*/
if @sysstat & 15 in (1, 3)
begin
/*
** the bits 0x2000, 0x4000 & 0x8000 represents any
** explicit lock scheme bits that can be set, so
** get them out ( 0x2000 + 0x4000 + 0x8000 = 57344)
*/
select @sysstat2 = (sysstat2 & 57344)
from sysobjects
where id = object_id(@objname)
/*
** The value 0, refers that no lock scheme is
** specified (old style tables) so they support only
** allpages locking
*/
if (@sysstat2 in (0, 8192, 16384, 32768))
begin
if (@sysstat2 = 8192 or @sysstat2 = 0)
begin
/* 17576, "Lock scheme is Allpages" */
exec sp_getmessage 17576, @msg out
print @msg
/* 18571, "The attribute '%1!' is */
/* not applicable to tables with */
/* allpages lock scheme." */
exec sp_getmessage 18571, @msg out
print @msg, 'exp_row_size'
/* 18571, "The attribute '%1!' is */
/* not applicable to tables with */
/* allpages lock scheme." */
exec sp_getmessage 18571, @msg out
print @msg, 'concurrency_opt_threshold'
end
if ( @sysstat2 = 16384 )
begin
/* 17577, "Lock scheme is Datapages" */
exec sp_getmessage 17577, @msg out
print @msg
/* 18983, "The '%1!' attribute is not applicable
** |