1
2
3 /*
4 ** This stored procedure prints all the server options, which have been set in
5 ** current session. @@options the array of bits corresponding to server options.
6 ** For every option, "low" is the byte number in @@options, and "high" is the
7 ** bit within that byte corresponding to the option. If the bit is set, print
8 ** name of that option.
9 */
10 create procedure sp_show_options
11 as
12 select a.number, a.name
13 from master.dbo.spt_values a, master.dbo.spt_values c
14 where c.type = "P"
15 and a.type = 'N'
16 and c.low <= datalength(@@options)
17 and a.number = c.number
18 and convert(tinyint, substring(@@options, c.low, 1)) & c.high != 0
19 return (0)
20
exec sp_procxmode 'sp_show_options', 'AnyMode'
go
Grant Execute on sp_show_options to public
go