1
2 /* Sccsid = "%Z% generic/sproc/%M% %I% %G%" */
3
4 /*
5 ** Messages for "sp_server_info"
6 **
7 ** 18059, "Attribute id %1! is not supported."
8 */
9
10 create procedure sp_server_info
11 @attribute_id int = NULL /* optional attribute id */
12 as
13
14
15 set nocount on
16
17 /* If an attribute id was specified then just return the info for that
18 ** attribute.
19 */
20 if @attribute_id is not null
21 begin
22 /* Verify that the attribute is valid. */
23 if not exists (select attribute_id
24 from sybsystemprocs.dbo.spt_server_info
25 where attribute_id = @attribute_id)
26 begin
27 /*
28 ** 18059, "Attribute id %1! is not supported."
29 */
30 raiserror 18059, @attribute_id
31 return (1)
32 end
33
34 /* Adaptive Server has expanded all '*' elements in the following statement */ select sybsystemprocs.dbo.spt_server_info.attribute_id, sybsystemprocs.dbo.spt_server_info.attribute_name, sybsystemprocs.dbo.spt_server_info.attribute_value
35 from sybsystemprocs.dbo.spt_server_info
36 where attribute_id = @attribute_id
37 end
38
39 /* If no attribute was specified then return info for all supported
40 ** attributes.
41 */
42 else
43 begin
44 /* Adaptive Server has expanded all '*' elements in the following statement */ select sybsystemprocs.dbo.spt_server_info.attribute_id, sybsystemprocs.dbo.spt_server_info.attribute_name, sybsystemprocs.dbo.spt_server_info.attribute_value
45 from sybsystemprocs.dbo.spt_server_info
46 end
47
48 return (0)
49
exec sp_procxmode 'sp_server_info', 'AnyMode'
go
Grant Execute on sp_server_info to public
go