1
2 /* Sccsid = "%Z% generic/sproc/%M% %I% %G%" */
3
4 /*
5 ** Messages for "sp_odbc_server_info"
6 **
7 ** 18059, "Attribute id %1! is not supported."
8 */
9
10 create procedure sp_odbc_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 from sybsystemprocs.dbo.spt_server_info
35 where attribute_id = @attribute_id
36 end
37
38 /* If no attribute was specified then return info for all supported
39 ** attributes.
40 */
41 else
42 begin
43 /* 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 from sybsystemprocs.dbo.spt_server_info
44 end
45
46 return (0)
47
exec sp_procxmode 'sp_odbc_server_info', 'AnyMode'
go
Grant Execute on sp_odbc_server_info to public
go