DatabaseProcApplicationCreatedLinks
sybsystemprocssp_setreplicate  14 déc. 14Defects Propagation Dependencies

1     
2     /*
3     ** Generated by spgenmsgs.pl on Wed Feb  8 14:55:58 2006 
4     */
5     /*
6     ** raiserror Messages for setreplicate [Total 11]
7     **
8     ** 17460, "Object must be in the current database."
9     ** 17756, "The execution of the stored procedure '%1!' in database '%2!' was aborted because there was an error in writing the replication log record."
10    ** 17961, "Usage: sp_setreplicate object_name, {true | false}"
11    ** 17962, "The replication status for '%1!' is already set to %2!. Replication status for '%3!' does not change."
12    ** 17963, "An object with the same name, but owned by a different user is already being replicated.  The object '%1!' cannot be replicated."
13    ** 17966, "Due to system failure, the replication status for '%1!' has not been changed."
14    ** 17969, "No user table or procedure named '%1!' exists in the current database."
15    ** 18409, "The built-in function '%1!' failed. Please see the other messages printed along with this message."
16    ** 18410, "The replication status of '%1!' is corrupt. Please contact Sybase Technical Support."
17    ** 18418, "Only the System Administrator (SA), the Database Owner (dbo) or a user with REPLICATION authorization may execute this stored procedure."
18    ** 18688, "Stored procedures with object parameters cannot be marked for replication yet at this time. Instead, use sp_setreptable to mark the invidual tables for replication. The replication status for '%1!' is not changed."
19    */
20    /*
21    ** sp_getmessage Messages for setreplicate [Total 5]
22    **
23    ** 17431, "true"
24    ** 17432, "false"
25    ** 17964, "The replication status for '%1!' is set to %2!."
26    ** 17965, "The replication status for '%1!' is currently %2!."
27    ** 17968, "The built-in function logschema() failed for '%1!'. See the other messages printed along with this message for more information."
28    */
29    /*
30    ** End spgenmsgs.pl output.
31    */
32    
33    create or replace procedure sp_setreplicate
34        @replicate_name varchar(767) = NULL, /* obj we want to mark as replicate */
35        @setflag varchar(5) = NULL /* set or unset the replicate status. */
36    as
37    
38        declare @current_status int /* current sysstat value for the object. */
39        declare @new_status int /* new sysstat value for the object. */
40        declare @new_status2 int /* new sysstat2 value for the object. */
41        declare @rep_constant smallint /* bit which indicates a replicated object. */
42        declare @dbccbit int /* The "on"/"off" bit for the DBCC command */
43        declare @db varchar(255) /* db of object. */
44        declare @owner varchar(255) /* owner of object. */
45        declare @object varchar(255) /* object's name. */
46        declare @true varchar(30)
47        declare @false varchar(30)
48        declare @msg varchar(1024)
49        declare @tmpstr varchar(10)
50        declare @sptlang int
51        declare @procval int
52        declare @rep_on_schema int /* log schema when turning replication on? */
53        declare @rep_off_schema int /* log schema when turning replication off? */
54        declare @objid int
55        declare @user_tran int /* are we inside a user tran? */
56        declare @after_image int /* log the after image of the schema */
57        declare @mod_versionts int /* modify version timestamp after logging
58        ** the schema
59        */
60        declare @dbname varchar(255)
61        declare @tmpid int /* Temporary variable for check to make
62        ** sure that the object is a user table
63        ** or a procedure	
64        */
65        declare @curstat int
66        declare @reptostandbyon int /* 1:  there are standby server */
67        declare @db_rep_level_all int /* All level replication */
68        declare @db_rep_level_none int /* no replication */
69        declare @db_rep_level_l1 int /* L1 level replication */
70        declare @xtype_token int /* Type for object parameters. */
71        declare @textlocator_token int /* Type for LOB TEXT locator or 
72        ** parameter 
73        */
74        declare @imagelocator_token int /* Type for LOB IMAGE locator or 
75        ** parameter 
76        */
77        declare @unitextlocator_token int /* Type for LOB UNITEXT locator
78        ** or parameter
79        */
80        declare @owner_bit int
81        declare @index_bit int
82        declare @colrepalwys smallint /* Always replicate */
83        declare @colrepifch smallint /* Replicate if changed */
84        declare @tipsa_in_index smallint /* Use index on text columns */
85        declare @texttype smallint /* Text datatype */
86        declare @imagetype smallint /* Image datatype */
87        declare @unitexttype smallint /* UNITEXT type. */
88        declare @xtype_type smallint /* Java column */
89        declare @offrow smallint
90        declare @lt_rep_get_failed int
91        declare @lt_rep_all int
92        declare @lt_rep_l1 int
93        declare @dummy int
94        declare @nullarg char(1)
95        declare @gp_enabled int
96        declare @status1 int
97        declare @status2 int
98        declare @status3 int
99    
100       select @status1 = 1
101       select @status2 = 1
102       select @status3 = 1
103   
104   
105       if @@trancount = 0
106       begin
107           set chained off
108       end
109   
110       if (@@trancount > 0)
111           select @user_tran = 1
112       else
113           select @user_tran = 0
114   
115       set transaction isolation level 1
116   
117       /*
118       ** Replication enabled flag is 8000H (which is -32768D)
119       */
120       select @rep_constant = - 32768
121   
122       /* set @rep_on_schema and rep_off_schema to false initially */
123       select @rep_on_schema = 0,
124           @rep_off_schema = 0,
125           @db_rep_level_all = - 1, /* -1: code for all level replication */
126           @db_rep_level_l1 = 1, /* 1:  code for L1 level replication */
127           @index_bit = 8388608, /* 0x800000 in sysstat2 */
128           @owner_bit = 4096, /* 0x1000 in sysstat2 */
129           @colrepalwys = 1,
130           @colrepifch = 2,
131           @tipsa_in_index = 2048,
132           @imagetype = 34,
133           @texttype = 35,
134           @xtype_type = 36,
135           @unitexttype = 174,
136           @offrow = 1,
137           @lt_rep_get_failed = - 2, /* LT_GET_REP_FAILED */
138           @lt_rep_all = 2048, /* LT_REP_ALL */
139           @lt_rep_l1 = 4096 /* LT_REP_L1 */
140   
141   
142       /*
143       ** Datatype value for object parameters is 36.
144       */
145       select @xtype_token = 36
146   
147       /* 
148       ** Column type value for LOB, stands for either of these datatypes:
149       ** text = 35, image = 34, unitext = 174.  
150       */
151       select @textlocator_token = 169
152       select @imagelocator_token = 170
153       select @unitextlocator_token = 171
154   
155   
156       /*
157       ** Initialize 'true' and 'false' strings
158       */
159       /* 17431, "true" */
160       exec sp_getmessage 17431, @true out
161       /* 17432, "false" */
162       exec sp_getmessage 17432, @false out
163   
164       /*
165       ** Set 'sptlang' for proper printing of object information.  Used mainly
166       ** for the 'select' statement which is executed when we are invoked with
167       ** no parameters.  Copied from similar code in 'sp_help'
168       */
169       select @sptlang = @@langid
170       if @@langid != 0
171       begin
172           if not exists (
173                   select * from master.dbo.sysmessages where error
174                       between 17100 and 17109
175                       and langid = @@langid)
176               select @sptlang = 0
177       end
178   
179       /*
180       ** If we are invoked with no parameters, then just print out all objects
181       ** which are marked for replication.  The 'select' statement is heavily
182       ** based upon the one found in 'sp_help'.
183       */
184       if (@replicate_name is NULL and @setflag is NULL)
185       begin
186           select
187               Name = o.name,
188               Type = convert(char(16), m.description + x.name)
189           into #show_replicate_obj
190           from
191               sysobjects o,
192               master.dbo.spt_values v,
193               master.dbo.spt_values x,
194               master.dbo.sysmessages m
195           where
196               o.sysstat & 2055 = v.number
197               and v.type = "O"
198               and v.msgnum = m.error
199               and isnull(m.langid, 0) = @sptlang
200               and m.error between 17100 and 17109
201               and x.type = "R"
202               and o.userstat & - 32768 = x.number
203               and (o.sysstat & @rep_constant) = @rep_constant
204   
205           exec sp_autoformat #show_replicate_obj
206   
207           drop table #show_replicate_obj
208   
209           return (0)
210       end
211   
212       /*
213       ** Crack the name into its corresponding pieces.
214       */
215       execute sp_namecrack @replicate_name,
216           @db = @db output,
217           @owner = @owner output,
218           @object = @object output
219   
220       /*
221       ** Make sure that the object is in the current database.
222       */
223       if (@db is not NULL and @db != db_name())
224       begin
225           /*
226           ** 17460, "Object must be in the current database."
227           */
228           raiserror 17460
229           return (1)
230       end
231   
232       /*
233       **  Make sure that the object actually exists.
234       */
235       select @objid = object_id(@replicate_name)
236   
237       /* Check if the object is either a procedure or user table */
238       select @tmpid = id from sysobjects
239       where id = @objid and type in ("P", "U")
240   
241       /* Error if the object does not exist or if it is not a user table or
242       ** procedure. 
243       */
244       if (@objid is NULL) or (@objid != @tmpid)
245       begin
246           /*
247           ** 17969, "No user table or procedure named '%1!' exists in the
248           ** 	   current database."
249           */
250           raiserror 17969, @object
251           return (1)
252       end
253   
254       /*
255       ** Currently, marking for replication user tables in the 'master' database
256       ** is not allowed.
257       **
258       ** Therefore, if the current database is the 'master' database and the
259       ** object is a user table, reset the '@setflag' to NULL so that the system
260       ** procedure will report the current status of the user table.  A proper
261       ** error message should be implemented at a later date.
262       */
263       if ((db_name() = "master") and
264               exists (select * from sysobjects where name = @object and type = "U"))
265       begin
266           select @setflag = NULL
267       end
268   
269       /*
270       ** If the 'setflag' parameter is NULL, then we are only interested in the
271       ** current replication status of the specified object.
272       */
273       if (@setflag is NULL)
274       begin
275           select
276               @current_status = sysstat
277           from
278               sysobjects holdlock
279           where
280               id = @objid
281   
282           if (@current_status & @rep_constant) = @rep_constant
283           begin
284               select @tmpstr = @true
285           end
286           else
287           begin
288               select @tmpstr = @false
289           end
290   
291           /*
292           ** 17965 "The replication status for '%1!' is currently %2!."
293           */
294           exec sp_getmessage 17965, @msg output
295           print @msg, @replicate_name, @tmpstr
296   
297           return (0)
298       end
299       /*
300       ** If granular permissions is not enabled, 
301       ** you must be SA, dbo or have REPLICATION role to execute this
302       ** sproc.
303       **  If granular permissions is enabled then users with 
304       ** 'manage replication' permission can execute it.
305       */
306       select @dbname = db_name()
307       select @nullarg = NULL
308       execute @status1 = sp_aux_checkroleperm "dbo", "manage replication",
309           @dbname, @gp_enabled output
310   
311       if (@gp_enabled = 0)
312       begin
313           if (@status1 != 0)
314           begin
315               execute @status2 = sp_aux_checkroleperm "sa_role",
316                   @nullarg, @nullarg, @gp_enabled output
317   
318               if (@status2 != 0)
319                   execute @status3 = sp_aux_checkroleperm
320                       "replication_role", @nullarg, @nullarg,
321                       @gp_enabled output
322   
323               if (@status3 != 0)
324               begin
325                   /*
326                   ** 18418, "Only the System Administrator (SA), the
327                   **         Database Owner (dbo) or a user with
328                   **         REPLICATION authorization may execute this
329                   **         stored procedure."
330                   */
331                   raiserror 18418
332                   return (1)
333               end
334           end
335           if (@status2 = 0)
336               select @dummy = proc_role("sa_role")
337           if (@status3 = 0)
338               select @dummy = proc_role("replication_role")
339       end
340       else
341       begin
342           select @dummy = proc_auditperm("manage replication", @status1, @dbname)
343           if (@status1 != 0)
344               return 1
345       end
346   
347       /*
348       ** Check for a valid setname parameter
349       */
350       if (lower(@setflag) not in ("true", "false", @true, @false))
351       begin
352           /*
353           ** 17961 "Usage: sp_setreplicate object_name, {true | false}"
354           */
355           raiserror 17961
356           return (1)
357       end
358   
359       select @curstat = getdbrepstat(),
360           @dbname = db_name()
361   
362       /*
363       ** Perform sanity checks on the returned value
364       ** getdbrepstat() return current status of replication server. Check returned
365       ** message, system supports only L1 and All level replication.   
366       */
367       if (@curstat = @lt_rep_get_failed)
368       begin
369           /*
370           ** 18409, "The built-in function getdbrepstat() failed. Please
371           ** see the other messages printed along with this message."
372           */
373           raiserror 18409, "getdbrepstat"
374           return (1)
375       end
376   
377       if ((@curstat & @lt_rep_all = @lt_rep_all) or
378               (@curstat & @lt_rep_l1 = @lt_rep_l1))
379       begin
380           select @reptostandbyon = 1
381       end
382       else
383       begin
384           select @reptostandbyon = 0
385       end
386   
387       /*
388       ** Get the object's current status. Hold a read lock on sysobjects so that 
389       **	the status cannot be changed until we're done.
390       */
391       select @current_status = sysstat, @new_status2 = sysstat2
392       from sysobjects holdlock
393       where id = @objid
394   
395       /*
396       ** Perform the requested operation on the object.
397       */
398       if lower(@setflag) in ("false", @false)
399       begin
400           /*
401           ** Is the replicate status bit even set?
402           */
403           if (@current_status & @rep_constant) = 0
404           begin
405               /*
406               ** 17962 "The replication status for '%1!' is already
407               **	  set to %2!.  Replication status for '%3!'
408               **	  does not change."
409               */
410               raiserror 17962, @replicate_name, @setflag, @replicate_name
411               return (1)
412           end
413   
414           select @new_status = @current_status & ~ @rep_constant
415           select @new_status2 = @new_status2 & ~ (@owner_bit | @index_bit)
416           select @dbccbit = 0
417           select @rep_off_schema = 1
418       end
419       else
420       begin
421           /*
422           ** We are turning on replication
423           **
424           ** Is the replicate status bit already set?
425           */
426           if (@current_status & @rep_constant) != 0
427           begin
428               /*
429               ** 17962 "The replication status for '%1!' is already
430               **	  set to %2!.  Replication status for '%3!'
431               **	  does not change."
432               */
433               raiserror 17962, @replicate_name, @setflag, @replicate_name
434               return (1)
435           end
436   
437           /*
438           ** Make sure that no like object with the same name, but a
439           ** different owner, exists.  We need to do this because
440           ** the SQL Server does not send owner information along
441           ** with the object to the Replication Server.  This
442           ** restriction may be lifted in future versions.
443           */
444           if exists (select * from sysobjects
445                   where name = @object
446                       and (
447                           (type = "U ") /* user table */
448                           or
449                           (type = "P ") /* stored procedure */
450                       )
451                       and sysstat & @rep_constant != 0)
452           begin
453               /*
454               ** 17963 "An object with the same name, but owned by a
455               **	  different user is already being replicated.
456               **	  The object '%1!' cannot be replicated."
457               */
458               raiserror 17963, @replicate_name
459               return (1)
460           end
461   
462           /*
463           ** Disallow procedures that have LOB or object parameters.
464           ** Replication of procedures with LOB or object parameters
465           ** is not supported yet.
466           */
467           if exists (select A.name
468                   from sysobjects A, syscolumns B
469                   where A.name = @object
470                       and A.type = "P"
471                       and A.id = B.id
472                       and (
473                           B.type = @xtype_token
474                           or
475                           B.type = @textlocator_token
476                           or
477                           B.type = @imagelocator_token
478                           or
479                           B.type = @unitextlocator_token
480                       ))
481   
482           begin
483               /*
484               ** 18688, "Stored procedures with LOB or object parameters
485               **         cannot be marked for replication yet at this time.
486               **         Instead, use sp_setreptable to mark the invidual
487               **         tables for replication. The replication status for
488               **         '%1!' is not changed."
489               */
490               raiserror 18688, @object
491               return (1)
492           end
493   
494           select @new_status = @current_status | @rep_constant
495           select @dbccbit = 1
496           select @rep_on_schema = 1
497       end
498   
499       /*
500       ** Update the object's sysstat column
501       **
502       ** IMPORTANT: This transaction name is significant and is used by
503       **            Replication Server
504       */
505       begin transaction rs_logexec
506   
507       /* log the schema first if we are turning off replication
508       ** or standby server is running
509       */
510       if ((@rep_off_schema = 1) or (@reptostandbyon = 1))
511       begin
512           select @after_image = 0
513           select @mod_versionts = 1
514           if (logschema(@objid, @user_tran, @after_image,
515                       @mod_versionts) != 1)
516           begin
517               /*
518               ** 17968 "The built-in function logschema() failed 
519               ** for '%1!'."
520               */
521               exec sp_getmessage 17968, @msg output
522               print @msg, @replicate_name
523   
524               rollback transaction
525               return (1)
526           end
527   
528           /* 
529           ** Update syscolumns status to remove any off-row replication
530           ** bit
531           */
532           update syscolumns
533           set status = status & ~ (@colrepalwys | @colrepifch)
534           where
535               id = @objid
536               and (type in (@imagetype, @texttype, @unitexttype)
537                   or (type = @xtype_type
538                       and (xstatus & @offrow) = @offrow))
539       end
540   
541       update sysobjects set sysstat = @new_status,
542           sysstat2 = @new_status2
543       where id = @objid
544   
545       /* 
546       ** Log the schema now if we are turning on replication and we are
547       ** inside a user tran
548       */
549       if ((@rep_on_schema = 1) and (@user_tran = 1))
550       begin
551           select @after_image = 1
552           select @mod_versionts = 0
553           if (logschema(@objid, @user_tran, @after_image,
554                       @mod_versionts) != 1)
555           begin
556               /*
557               ** 17968 "The built-in function logschema() failed 
558               ** for '%1!'."
559               */
560               exec sp_getmessage 17968, @msg output
561               print @msg, @replicate_name
562   
563               rollback transaction
564               return (1)
565           end
566       end
567   
568       /*
569       ** Update the object's status in cache.
570       */
571       dbcc setreplicate(@replicate_name, @dbccbit)
572   
573       if @@error != 0
574       begin
575           /*
576           ** 17966 "Due to system failure, the replication status
577           **	  for '%1!' has not been changed."
578           */
579           raiserror 17966, @replicate_name, @setflag
580   
581           rollback transaction
582   
583           return (1)
584       end
585   
586       /*
587       ** Write the log record to replicate this invocation 
588       ** of the stored procedure.
589       */
590       if (logexec() != 1)
591       begin
592           /*
593           ** 17756, "The execution of the stored procedure '%1!'
594           ** 	   in database '%2!' was aborted because there
595           ** 	   was an error in writing the replication log
596           **	   record."
597           */
598           raiserror 17756, "sp_setreplicate", @dbname
599   
600           rollback transaction rs_logexec
601           return (1)
602       end
603   
604       commit transaction
605   
606       /*
607       ** 17964 "The replication status for '%1!' is set to %2!."
608       */
609       exec sp_getmessage 17964, @msg output
610       print @msg, @replicate_name, @setflag
611       return (0)
612   


exec sp_procxmode 'sp_setreplicate', 'AnyMode'
go

Grant Execute on sp_setreplicate to public
go
DEFECTS
 MINU 4 Unique Index with nullable columns master..sysmessages master..sysmessages
 MTYP 4 Assignment type mismatch @tmpstr: varchar(10) = varchar(30) 284
 MTYP 4 Assignment type mismatch @tmpstr: varchar(10) = varchar(30) 288
 MTYP 4 Assignment type mismatch sysstat: smallint = int 541
 MUSP 4 Unquoted String Parameter sybsystemprocs..sp_autoformat: parameter # 1 205
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 175
 QTYP 4 Comparison type mismatch smallint = int 175
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 473
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 475
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 477
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs int 479
 QTYP 4 Comparison type mismatch Comparison type mismatch: tinyint vs smallint 537
 QTYP 4 Comparison type mismatch tinyint = smallint 537
 TNOU 4 Table with no unique index master..spt_values master..spt_values
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 238
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 239
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 280
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 393
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 471
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 471
 MAW1 3 Warning message on %name% sybsystemprocs..syscolumns.id: Warning message on syscolumns 535
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 543
 MGTP 3 Grant to public master..spt_values  
 MGTP 3 Grant to public master..sysmessages  
 MGTP 3 Grant to public sybsystemprocs..sp_setreplicate  
 MGTP 3 Grant to public sybsystemprocs..syscolumns  
 MGTP 3 Grant to public sybsystemprocs..sysobjects  
 MNER 3 No Error Check should check return value of exec 160
 MNER 3 No Error Check should check return value of exec 162
 MNER 3 No Error Check should check @@error after select into 186
 MNER 3 No Error Check should check return value of exec 205
 MNER 3 No Error Check should check return value of exec 215
 MNER 3 No Error Check should check return value of exec 294
 MNER 3 No Error Check should check return value of exec 521
 MNER 3 No Error Check should check @@error after update 532
 MNER 3 No Error Check should check @@error after update 541
 MNER 3 No Error Check should check return value of exec 560
 MNER 3 No Error Check should check return value of exec 609
 MUCO 3 Useless Code Useless Brackets 110
 MUCO 3 Useless Code Useless Brackets 184
 MUCO 3 Useless Code Useless Brackets 209
 MUCO 3 Useless Code Useless Brackets 223
 MUCO 3 Useless Code Useless Brackets 229
 MUCO 3 Useless Code Useless Brackets 251
 MUCO 3 Useless Code Useless Brackets 263
 MUCO 3 Useless Code Useless Brackets 273
 MUCO 3 Useless Code Useless Brackets 297
 MUCO 3 Useless Code Useless Brackets 311
 MUCO 3 Useless Code Useless Brackets 313
 MUCO 3 Useless Code Useless Brackets 318
 MUCO 3 Useless Code Useless Brackets 323
 MUCO 3 Useless Code Useless Brackets 332
 MUCO 3 Useless Code Useless Brackets 335
 MUCO 3 Useless Code Useless Brackets 337
 MUCO 3 Useless Code Useless Brackets 343
 MUCO 3 Useless Code Useless Brackets 350
 MUCO 3 Useless Code Useless Brackets 356
 MUCO 3 Useless Code Useless Brackets 367
 MUCO 3 Useless Code Useless Brackets 374
 MUCO 3 Useless Code Useless Brackets 377
 MUCO 3 Useless Code Useless Brackets 411
 MUCO 3 Useless Code Useless Brackets 434
 MUCO 3 Useless Code Useless Brackets 459
 MUCO 3 Useless Code Useless Brackets 491
 MUCO 3 Useless Code Useless Brackets 510
 MUCO 3 Useless Code Useless Brackets 514
 MUCO 3 Useless Code Useless Brackets 525
 MUCO 3 Useless Code Useless Brackets 549
 MUCO 3 Useless Code Useless Brackets 553
 MUCO 3 Useless Code Useless Brackets 564
 MUCO 3 Useless Code Useless Brackets 583
 MUCO 3 Useless Code Useless Brackets 590
 MUCO 3 Useless Code Useless Brackets 601
 MUCO 3 Useless Code Useless Brackets 611
 QCTC 3 Conditional Table Creation 186
 QISO 3 Set isolation level 115
 QNAJ 3 Not using ANSI Inner Join 190
 QNAJ 3 Not using ANSI Inner Join 468
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysmessages.ncsysmessages unique
(error, dlevel, langid)
Intersection: {error, langid}
173
 QPRI 3 Join or Sarg with Rooted Partial Index Use JOIN Candidate index: sysmessages.ncsysmessages unique
(error, dlevel, langid)
Intersection: {error}
Uncovered: [dlevel]
198
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysobjects.ncsysobjects unique
(name, uid)
Intersection: {name}
264
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysobjects.ncsysobjects unique
(name, uid)
Intersection: {name}
445
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysobjects.ncsysobjects unique
(name, uid)
Intersection: {name}
469
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: syscolumns.csyscolumns unique clustered
(id, number, colid)
Intersection: {id}
535
 VNRD 3 Variable is not read @db_rep_level_all 125
 VNRD 3 Variable is not read @db_rep_level_l1 126
 VNRD 3 Variable is not read @tipsa_in_index 131
 VNRD 3 Variable is not read @owner 217
 VNRD 3 Variable is not read @gp_enabled 321
 VNRD 3 Variable is not read @dummy 342
 VUNU 3 Variable is not used @procval 51
 VUNU 3 Variable is not used @db_rep_level_none 68
 MSUB 2 Subquery Marker 172
 MSUB 2 Subquery Marker 264
 MSUB 2 Subquery Marker 444
 MSUB 2 Subquery Marker 467
 MTR1 2 Metrics: Comments Ratio Comments: 49% 33
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 45 = 60dec - 17exi + 2 33
 MTR3 2 Metrics: Query Complexity Complexity: 262 33
 PRED_QUERY_COLLECTION 2 {m=master..sysmessages, o=sybsystemprocs..sysobjects, sv=master..spt_values, sv2=master..spt_values} 0 186
 PRED_QUERY_COLLECTION 2 {c=sybsystemprocs..syscolumns, o=sybsystemprocs..sysobjects} 0 467

DEPENDENCIES
PROCS AND TABLES USED
reads table master..sysmessages (1)  
read_writes table sybsystemprocs..syscolumns  
writes table tempdb..#show_replicate_obj (1) 
calls proc sybsystemprocs..sp_getmessage  
   calls proc sybsystemprocs..sp_validlang  
      reads table master..syslanguages (1)  
   reads table master..syslanguages (1)  
   reads table sybsystemprocs..sysusermessages  
   reads table master..sysmessages (1)  
reads table master..spt_values (1)  
calls proc sybsystemprocs..sp_aux_checkroleperm  
   reads table master..syscurconfigs (1)  
   reads table master..sysconfigures (1)  
read_writes table sybsystemprocs..sysobjects  
calls proc sybsystemprocs..sp_autoformat  
   writes table sybsystemprocs..sp_autoformat_rset_002 
   reads table master..syscolumns (1)  
   reads table master..systypes (1)  
   writes table sybsystemprocs..sp_autoformat_rset_004 
   calls proc sybsystemprocs..sp_autoformat  
   read_writes table tempdb..#colinfo_af (1) 
   reads table tempdb..systypes (1)  
   writes table sybsystemprocs..sp_autoformat_rset_001 
   reads table tempdb..syscolumns (1)  
   writes table sybsystemprocs..sp_autoformat_rset_003 
   calls proc sybsystemprocs..sp_namecrack  
   writes table sybsystemprocs..sp_autoformat_rset_005 
calls proc sybsystemprocs..sp_namecrack