1
2
3 /*
4 ** This stored procedure translates to text the bitmap
5 ** returned by the built-in tran_dumpable_status().
6 **
7 ** Parameters:
8 ** @dbname - DB name to query or NULL for current
9 **
10 */
11 create procedure sp_tran_dumpable_status @dbname sysname = NULL
12 as
13 begin
14 declare @status int
15
16 if (@dbname is null)
17 select @dbname = db_name()
18
19 select @status = tran_dumpable_status(@dbname)
20
21 select bit = power(2, a.number), description = a.name
22 from master.dbo.spt_values a, master.dbo.spt_values c
23 where c.type = 'P'
24 and a.type = 'DX'
25 and c.low <= datalength(@status)
26 and a.number = c.number
27 and convert(tinyint, substring(@status, c.low, 1)) & c.high != 0
28
29 return (0)
30 end
31
32
exec sp_procxmode 'sp_tran_dumpable_status', 'AnyMode'
go
Grant Execute on sp_tran_dumpable_status to public
go