DatabaseProcApplicationCreatedLinks
sybsystemprocssp_drv_gettypes  14 déc. 14Defects Propagation Dependencies

1     
2     
3     CREATE OR REPLACE PROCEDURE sp_drv_gettypes(@sstype int = 0, @usertype int = 0)
4     as
5         declare @cmd varchar(1024)
6     
7         SELECT @cmd = ' SELECT name=case 
8     	when b.usertype=18 then ''sysname'' 
9     	when b.usertype=25 then ''nvarchar'' 
10    	when b.usertype=42 then ''longsysname'' 
11    	when b.usertype=80 then ''timestamp'' 
12    	when b.usertype=24 then ''nchar'' 
13    	when a.ss_dtype=111 then ''datetimn'' 
14    	when a.ss_dtype=109 then ''floatn'' 
15    	else local_type_name end,
16    	a.ss_dtype,
17    	b.usertype 
18    	from sybsystemprocs.dbo.spt_datatype_info a,
19    	systypes b 
20    	where a.ss_dtype=b.type  '
21    
22        if @sstype > 0 AND @usertype > 0
23        begin
24            SELECT @cmd = @cmd + ' AND a.ss_dtype=' + convert(varchar(10), @sstype) + '  AND b.usertype=' + convert(varchar(10), @usertype)
25    
26        end
27        else if @sstype = 0 AND @usertype = 0
28        begin
29            SELECT @cmd = @cmd
30        end
31        else if @sstype = 0
32        begin
33            SELECT @cmd = @cmd + '  AND b.usertype=' + convert(varchar(10), @usertype)
34    
35        end
36        else if @usertype = 0
37        begin
38            SELECT @cmd = @cmd + ' AND a.ss_dtype=' + convert(varchar(10), @sstype)
39        end
40    
41        execute (@cmd)
42    
43    


exec sp_procxmode 'sp_drv_gettypes', 'AnyMode'
go

Grant Execute on sp_drv_gettypes to public
go
DEFECTS
 MDYN 3 Proc uses Dynamic SQL but is not flagged with Dynamic Ownership Chain 3
 MGTP 3 Grant to public sybsystemprocs..sp_drv_gettypes  
 MUCO 3 Useless Code Useless Brackets in create proc 3
 MDYS 2 Dynamic SQL Marker 41
 MTR1 2 Metrics: Comments Ratio Comments: 0% 3
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 8 = 7dec - 1exi + 2 3
 MTR3 2 Metrics: Query Complexity Complexity: 18 3

DEPENDENCIES