|
page' will be displayed.
**
** Table level setting for option dealloc_first_txtpg (sysstat2 in sysobjects)
** 0x2000000 ---- 536870912, deallocate first text page after NULL update
** 0x8000000 ---- -2147483648, keep first text page after NULL update
**
** DB level setting for option 'deallocate first text page' (status4 in sysdatabases)
** 0x8000000 ---- -2147483648, deallocate first text page after NULL update
*/
select @db_dealloc_ftp = hextoint('0x80000000')
select @tab_dealloc_ftp = hextoint('0x20000000')
select @tab_keep_ftp = hextoint('0x80000000')
select @sysstat2 = sysstat2, @objtype = type
from sysobjects
where id = object_id(@objname)
/*
** Only check user tables
*/
if (@objtype = 'U')
begin
select @db_stat4 = status4 from master.dbo.sysdatabases
where dbid = db_id()
if ((@sysstat2 & @tab_dealloc_ftp != 0) or
((@sysstat2 & @tab_keep_ftp = 0) and (@db_stat4 & @db_dealloc_ftp != 0)))
begin
select @valstat2 = @tab_dealloc_ftp
end
else
begin
select @valstat2 = @tab_keep_ftp
end
select @msgnum = msgnum, @sysopt_name = name, @sep = ''
from master.dbo.spt_values
where type = 'O2' and number = @valstat2
if (@msgnum != 17119)
begin
select @sysopt_name = isnull(description, @sysopt_name)
from master.dbo.sysmessages
where error = @msgnum
and isnull(langid, 0) = @sptlang
update #sphelp5rs
set Object_status = ltrim(Object_status + @sep + @sysopt_name)
from #sphelp5rs a, sysobjects o
where a.Name = o.name
and o.sysstat & 15 = 3
and o.id = object_id(@objname)
end
end -- }
/* Set Object_status based on sysstat3 to show any special status the object may have */
select @sysstat3 = sysstat3, @objtype = type
from sysobjects
where id = object_id(@objname)
select @valstat3 = min(number), @sep = ''
from master.dbo.spt_values
where type = 'O3'
and number > 0
and number & @sysstat3 = number
while (@valstat3 is not null)
begin -- {
select @msgnum = msgnum, @sysopt_name = name
from master.dbo.spt_values
where type = 'O3' and number = @valstat3
/* We do not allow PRS objects to be defined on other PRS
** objects. Even if we plan to support this in future, this
** will be a major design change and sp_help will have to be
** updated accordingly to allow that. The bit 0x40 in sysstat3
** is currently overridden to check if PRS objects are defined
** on any object.
*/
if not (@objtype = 'RS' and @msgnum = 17119)
begin
select @sysopt_name = isnull(description, @sysopt_name)
from master.dbo.sysmessages
where error = @msgnum
and isnull(langid, 0) = @sptlang
update #sphelp5rs
set Object_status = ltrim(Object_status + @sep + @sysopt_name)
from #sphelp5rs a, sysobjects o
where a.Name = o.name
and o.sysstat & 15 in (3, 4)
and o.sysstat3 & @valstat3 = @valstat3
end
select @valstat3 = min(number), @sep = ', '
from master.dbo.spt_values
where type = 'O3'
and number > @valstat3
and number & @sysstat3 = number
end -- }
/*
** If the object type is precomputed result set then set Object_status
** information with the following properties:
** a. Refresh Policy: immediate/manual
** b. State: enabled/disabled
** c. QRW State: enabled/disabled for QRW
*/
if @objtype = 'RS'
begin -- {
/* #sphelp5rs will only have 1 row corresponding to a PRS */
update #sphelp5rs
set
Object_status =
/* |