ÿþ/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
 s P r o c   N a m e : 	       s p C r e a t e S u b s c r i p t i o n s  
 A u t h o r : 	 	 	 F r a n k   B a z a n  
 D e s c r i p t i o n : 	 T h i s   s c r i p t : -    
 	 	 	 	 a ) 	 A d d s   a   p u s h   s u b s c r i p t i o n  
 	 	 	 	 b ) 	 A d d s   a   s u b s c r i p t i o n   a g e n t .  
 	 	 	 	 R u n   o n   p u b l i s h e r   s e r v e r   f o r   a n y   n e w   s u b s c r i p t i o n s .  
  
 R u n n i n g   i n s t r u c t i o n s  
 	 	 1 ) 	 E n s u r e   c o n n e c t e d   t o   p u b l i s h i n g   s e r v e r .  
 	 	 2 ) 	 E n s u r e   t h a t   d b o . P u b l i c a t i o n   a n d   d b o . S u b s c r i p t i o n   a r e   p o p u l a t e d   a s   r e q u i r e d  
  
 H i s t o r y  
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
 V e r s 	 A u t h o r 	 	 	 	 D a t e 	 	 	 D e s c r i p t i o n   o f   C h a n g e  
 - - - - 	 - - - - - - 	 	 	 	 - - - - 	 	 	 - - - - - - - - - - - - - - - - - - - - -  
 1 . 0 	 F r a n k   B a z a n 	 	 	 2 0 0 7 - 0 5 - 2 3 	 	 1 s t   E f f o r t  
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
  
 I F   E X I S T S   (   S E L E C T   1   F R O M   I N F O R M A T I O N _ S C H E M A . R O U T I N E S  
                         W H E R E   R O U T I N E _ N A M E   =   ' s p C r e a t e S u b s c r i p t i o n s '  
                         A N D   R O U T I N E _ T Y P E   =   ' P R O C E D U R E '   )  
 B E G I N  
       D R O P   P R O C E D U R E   s p C r e a t e S u b s c r i p t i o n s  
 E N D  
 G O  
 C R E A T E   P R O C E D U R E   [ d b o ] . [ s p C r e a t e S u b s c r i p t i o n s ]  
  
 A S  
  
 S E T   N O C O U N T   O N  
 - -   T a b l e   v a r i a b l e   h o l d s   t h e   o u b l i c a t i o n   a n d   s u b s c r i b e r   d a t a .  
 D E C L A R E   @ S u b s c r i p t i o n s   T A B L E   ( 	  
 	 	 	 	 	 	 	 	 S u b s c r i p t i o n s I d   I N T   I D E N T I T Y   N O T   N U L L ,  
 	 	 	 	 	 	 	 	 S u b s c r i p t i o n I d   I N T   N O T   N U L L , 	 	 	 	  
 	 	 	 	 	 	 	 	 P u b l i c a t i o n I d   I N T   N O T   N U L L ,  
 	 	 	 	 	 	 	 	 P u b l i c a t i o n N a m e   N V A R C H A R ( 1 2 8 )   N O T   N U L L ,  
 	 	 	 	 	 	 	 	 P u b l i c a t i o n D b   N V A R C H A R ( 1 2 8 )   N O T   N U L L ,  
 	 	 	 	 	 	 	 	 S u b s c r i p t i o n D b   N V A R C H A R ( 1 2 8 )   N O T   N U L L ,  
 	 	 	 	 	 	 	 	 S u b s c r i b e r S e r v e r   N V A R C H A R ( 1 2 8 )   N O T   N U L L ,  
 	 	 	 	 	 	 	 	 S e c u r i t y M o d e   B I T   N O T   N U L L ,  
 	 	 	 	 	 	 	 	 S u b s c r i b e r L o g i n   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 	 	 	 	 	 S u b s c r i b e r P a s s w o r d   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 	 	 	 	 	 D i s t r i b u t i o n A g e n t L o g i n   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 	 	 	 	 	 D i s t r i b u t i o n A g e n t P w d   N V A R C H A R ( 1 2 8 ) ,  
                                                 F r e q u e n c y T y p e   I N T ) 	 	 	 	 	 	 	    
  
 - -   P o p u l a t e   A L L   s u b s c r i p t i o n s  
 I N S E R T   I N T O   @ S u b s c r i p t i o n s  
 	 	 ( S u b s c r i p t i o n I d ,  
 	 	 P u b l i c a t i o n I d ,  
 	 	 P u b l i c a t i o n N a m e ,  
 	 	 P u b l i c a t i o n D b ,  
 	 	 S u b s c r i p t i o n D b ,  
 	 	 S u b s c r i b e r S e r v e r ,  
 	 	 S e c u r i t y M o d e ,  
 	 	 S u b s c r i b e r L o g i n ,  
 	 	 S u b s c r i b e r P a s s w o r d ,  
 	 	 D i s t r i b u t i o n A g e n t L o g i n ,  
 	 	 D i s t r i b u t i o n A g e n t P w d ,  
             F r e q u e n c y T y p e  
 	 	 )  
 S E L E C T 	 S . S u b s c r i p t i o n I d ,  
 	 	 S . P u b l i c a t i o n I d ,  
 	 	 ' ( '   +   P . D a t a U s e r C o d e   +   ' ) '   +   S P A C E ( 1 )   +   P . P u b l i c a t i o n N a m e   A S   P u b l i c a t i o n N a m e ,  
 	 	 P . P u b l i c a t i o n D a t a b a s e ,  
 	 	 S . S u b s c r i p t i o n D a t a b a s e ,  
 	 	 S . S u b s c r i b e r S e r v e r ,  
 	 	 C A S T ( S . S u b s c r i b e r S e c u r i t y M o d e   A S   I N T )   A S   S u b s c r i b e r S e c u r i t y M o d e ,  
 	 	 S . S u b s c r i b e r L o g i n ,  
 	 	 S . S u b s c r i b e r P a s s w o r d ,  
 	 	 S . D i s t r i b u t i o n A g e n t L o g i n ,  
 	 	 S . D i s t r i b u t i o n A g e n t P w d ,  
             C A S E  
                   W H E N   S . I s D i s t r i b u t i o n O n D e m a n d   =   1   T H E N   2  
                   E L S E   6 4  
             E N D   A S   F r e q u e n c y T y p e  
  
 F R O M 	 S e r v e r C o n t r o l . d b o . S u b s c r i p t i o n   S  
  
 J O I N 	 S e r v e r C o n t r o l . d b o . P u b l i c a t i o n   P  
 O N 	 	 S . P u b l i c a t i o n I d   =   P . P u b l i c a t i o n I d  
  
  
 D E C L A R E 	 @ P u b l i c a t i o n D b   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 @ S u b s c r i p t i o n D b   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 @ P u b l i c a t i o n N a m e   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 @ S u b s c r i b e r S e r v e r   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 @ S u b s c r i b e r S e c u r i t y M o d e   I N T ,  
 	 	 	 @ S u b s c r i b e r L o g i n   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 @ S u b s c r i b e r P a s s w o r d   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 @ D i s t r i b u t i o n A g e n t L o g i n   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 @ D i s t r i b u t i o n A g e n t P w d   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 @ S u b C o u n t e r   I N T ,  
 	 	 	 @ M a x S u b C o u n t   I N T ,  
                   @ F r e q u e n c y T y p e   I N T  
  
 - -   I n i t i a l i s e   C o u n t e r s  
 S E T 	 	 	 @ S u b C o u n t e r   =   1  
 S E T 	 	 	 @ M a x S u b C o u n t   =   ( S E L E C T   M A X ( S u b s c r i p t i o n s I d )   F R O M   @ S u b s c r i p t i o n s   )  
  
 - -   S e t   u p   t h e   l o o p  
 W H I L E   @ S u b C o u n t e r   < =   @ M a x S u b C o u n t  
 B E G I N  
  
 - -   S e t   v a r i a b l e s   r e q u i r e d   f o r   s u b s c r i p t i o n   c o n f i g  
 S E L E C T 	 @ P u b l i c a t i o n D b   =   ( S E L E C T   P u b l i c a t i o n D b   F R O M   @ S u b s c r i p t i o n s   W H E R E   S u b s c r i p t i o n s I d   =   @ S u b C o u n t e r ) ,  
 	 	 	 @ S u b s c r i p t i o n D b   =   ( S E L E C T   S u b s c r i p t i o n D b   F R O M   @ S u b s c r i p t i o n s   W H E R E   S u b s c r i p t i o n s I d   =   @ S u b C o u n t e r ) ,  
 	 	 	 @ P u b l i c a t i o n N a m e   =   ( S E L E C T   P u b l i c a t i o n N a m e   F R O M   @ S u b s c r i p t i o n s   W H E R E   S u b s c r i p t i o n s I d   =   @ S u b C o u n t e r ) ,  
 	 	 	 @ S u b s c r i b e r S e r v e r   =   ( S E L E C T   S u b s c r i b e r S e r v e r   F R O M   @ S u b s c r i p t i o n s   W H E R E   S u b s c r i p t i o n s I d   =   @ S u b C o u n t e r ) ,  
 	 	 	 @ S u b s c r i b e r S e c u r i t y M o d e   =   ( S E L E C T   S e c u r i t y M o d e   F R O M   @ S u b s c r i p t i o n s   W H E R E   S u b s c r i p t i o n s I d   =   @ S u b C o u n t e r ) ,  
 	 	 	 @ S u b s c r i b e r L o g i n   =   ( S E L E C T   S u b s c r i b e r L o g i n   F R O M   @ S u b s c r i p t i o n s   W H E R E   S u b s c r i p t i o n s I d   =   @ S u b C o u n t e r ) ,  
 	 	 	 @ S u b s c r i b e r P a s s w o r d   =   ( S E L E C T   S u b s c r i b e r P a s s w o r d   F R O M   @ S u b s c r i p t i o n s   W H E R E   S u b s c r i p t i o n s I d   =   @ S u b C o u n t e r ) ,  
 	 	 	 @ D i s t r i b u t i o n A g e n t L o g i n   =   ( S E L E C T   D i s t r i b u t i o n A g e n t L o g i n   F R O M   @ S u b s c r i p t i o n s   W H E R E   S u b s c r i p t i o n s I d   =   @ S u b C o u n t e r ) ,  
 	 	 	 @ D i s t r i b u t i o n A g e n t P w d   =   ( S E L E C T   D i s t r i b u t i o n A g e n t P w d   F R O M   @ S u b s c r i p t i o n s   W H E R E   S u b s c r i p t i o n s I d   =   @ S u b C o u n t e r ) ,  
                   @ F r e q u e n c y T y p e   =   ( S E L E C T   F r e q u e n c y T y p e   F R O M   @ S u b s c r i p t i o n s   W H E R E   S u b s c r i p t i o n s I d   =   @ S u b C o u n t e r )  
  
  
  
 	 	 	 E X E C   ( ' U S E   '   +   @ P u b l i c a t i o n D b   +   '  
  
 	 	 	 D E C L A R E 	 	 @ S t a t u s   I N T ,  
                                           @ N L   C H A R ( 1 ) ,  
 	 	 	 	 	 	 	 @ S u b M s g   N V A R C H A R ( 5 0 0 ) ,  
 	 	 	 	 	 	 	 @ S u b s c r i b e r S e c u r i t y M o d e   I N T ,  
 	 	 	 	 	 	 	 @ S u b s c r i b e r S Q L L o g i n   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 	 	 	 	 @ S u b s c r i b e r S Q L P w d   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 	 	 	 	 @ S u b s c r i b e r W i n d o w s L o g i n   N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 	 	 	 	 @ S u b s c r i b e r W i n d o w s P w d   N V A R C H A R ( 1 2 8 )  
  
 	 S E T   @ S u b s c r i b e r S e c u r i t y M o d e   =   '   +   @ S u b s c r i b e r S e c u r i t y M o d e   +   '    
 	 S E T   @ S u b s c r i b e r S Q L L o g i n   = 	 	 N U L L I F ( ' ' '   +   @ S u b s c r i b e r L o g i n   +   ' ' ' , ' ' ' ' )  
 	 S E T   @ S u b s c r i b e r S Q L P w d   = 	 	 	 N U L L I F ( ' ' '   +   @ S u b s c r i b e r P a s s w o r d   +   ' ' ' , ' ' ' ' )  
 	 S E T   @ S u b s c r i b e r W i n d o w s L o g i n   = 	 N U L L I F ( ' ' '   +   @ D i s t r i b u t i o n A g e n t L o g i n   +   ' ' ' , ' ' ' ' )  
 	 S E T   @ S u b s c r i b e r W i n d o w s P w d   = 	 	 N U L L I F ( ' ' '   +   @ D i s t r i b u t i o n A g e n t P w d   +   ' ' ' , ' ' ' ' )  
       S E T   @ N L   =   C H A R ( 1 3 )  
  
  
 	 	 	 - -   S e e   i f   t h e r e   i s   a   s u b s c r i p t i o n   a l r e a d y  
 	 	 	 E X E C   s p _ h e l p s u b s c r i p t i o n    
 	 	 	 	 	 @ P u b l i c a t i o n   =   ' ' '   +   @ P u b l i c a t i o n N a m e   +   ' ' ' ,    
 	 	 	 	 	 @ S u b s c r i b e r   =   ' ' '   +   @ S u b s c r i b e r S e r v e r   +   ' ' ' ,  
 	 	 	 	 	 @ f o u n d   =   @ S t a t u s   O U T P U T  
  
 	 I F   @ S t a t u s   =   0    
 	 	 	 - -   N o   s u b s c r i p t i o n   t o   t h i s   p u b   o n   t h i s   s e r v e r  
 	 	 	 B E G I N  
 	 	 	 - -   V a r i a b l e s   f o r   a d d i n g   s u b s c r i p t i o n  
 	 	 	 D E C L A R E 	 	 	 @ P u b l i c a t i o n N a m e 	 N V A R C H A R ( 1 2 8 ) ,    
 	 	 	 	 	 	 	 	 @ S u b s c r i b e r S e r v e r 	 N V A R C H A R ( 1 2 8 ) ,  
 	 	 	 	 	 	 	 	 @ D e s t i n a t i o n D b 	 	 N V A R C H A R ( 1 2 8 ) ,    
 	 	 	 	 	 	 	 	 @ S u b s c r i p t i o n T y p e 	 N V A R C H A R ( 4 ) ,    
 	 	 	 	 	 	 	 	 @ S y n c T y p e 	 	 	 N V A R C H A R ( 1 5 ) ,    
 	 	 	 	 	 	 	 	 @ A r t i c l e N a m e   	 	 N V A R C H A R ( 1 2 8 ) ,    
 	 	 	 	 	 	 	 	 @ U p d a t e M o d e 	 	 	 N V A R C H A R ( 3 0 ) ,    
 	 	 	 	 	 	 	 	 @ S u b s c r i b e r T y p e 	 T I N Y I N T ,  
                                                 @ F r e q u e n c y T y p e         I N T  
  
 	 	 	 - -   A s s i g n   v a r i a b l e s   f o r   a d d i n g   s u b s c r i p t i o n  
 	 	 	 S E L E C T 	 	 	 @ P u b l i c a t i o n N a m e 	 =   N ' ' '   +   @ P u b l i c a t i o n N a m e   +   ' ' ' ,    
 	 	 	 	 	 	 	 	 @ S u b s c r i b e r S e r v e r 	 =   N ' ' '   +   @ S u b s c r i b e r S e r v e r   +   ' ' ' ,    
 	 	 	 	 	 	 	 	 @ D e s t i n a t i o n D b 	 	 =   N ' ' '   +   @ S u b s c r i p t i o n D b   +   ' ' ' ,    
 	 	 	 	 	 	 	 	 @ S u b s c r i p t i o n T y p e 	 =   N ' ' P u s h ' ' ,    
 	 	 	 	 	 	 	 	 @ S y n c T y p e 	 	 	 =   N ' ' a u t o m a t i c ' ' ,    
 	 	 	 	 	 	 	 	 @ A r t i c l e N a m e 	 	 =   N ' ' a l l ' ' ,    
 	 	 	 	 	 	 	 	 @ U p d a t e M o d e 	 	 	 =   N ' ' r e a d   o n l y ' ' ,    
 	 	 	 	 	 	 	 	 @ S u b s c r i b e r T y p e 	 =   0 ,  
                                                 @ F r e q u e n c y T y p e     =   '   +   @ F r e q u e n c y T y p e   +   '  
  
 	 	 	 - -   E x e c u t e   t h e   c o m m a n d  
 	 	 	 E X E C   s p _ a d d s u b s c r i p t i o n    
 	 	 	 	 	 	 	 	 @ p u b l i c a t i o n   =   @ P u b l i c a t i o n N a m e ,    
 	 	 	 	 	 	 	 	 @ s u b s c r i b e r   =   @ S u b s c r i b e r S e r v e r ,    
 	 	 	 	 	 	 	 	 @ d e s t i n a t i o n _ d b   =   @ D e s t i n a t i o n D b ,    
 	 	 	 	 	 	 	 	 @ s u b s c r i p t i o n _ t y p e   =   @ S u b s c r i p t i o n T y p e ,    
 	 	 	 	 	 	 	 	 @ s y n c _ t y p e   =   @ S y n c T y p e ,    
 	 	 	 	 	 	 	 	 @ a r t i c l e   =   @ A r t i c l e N a m e ,    
 	 	 	 	 	 	 	 	 @ u p d a t e _ m o d e   =   @ U p d a t e M o d e ,    
 	 	 	 	 	 	 	 	 @ s u b s c r i b e r _ t y p e   =   @ S u b s c r i b e r T y p e  
  
                   - - I n f o r m   u s e r   o f   r u n t i m e   p a r a m e t e r s   u s e d  
                   S E T   @ S u b M s g   =   @ N L   +   ' ' S e c u r i t y   C r e d e n t i a l s   s u p p l i e d   f o r   t h e   d i s t r i b u t i o n   a g e n t   t o   c o n n e c t   t o   d a t a b a s e   " ' '   +   @ D e s t i n a t i o n D b   +   ' ' "   o n   S u b s c r i b e r   " ' '   +   @ S u b s c r i b e r S e r v e r   +   ' ' " ' '   +   @ N L   +  
                                           ' ' P u b l i c a t i o n :   " ' '   +   @ P u b l i c a t i o n N a m e   +   ' ' " ' '   +   @ N L   +   @ N L   +  
                                           ' ' * *   W i l l   a t t e m p t   t o   c o n n e c t   t o   s u b s c r i b e r   u s i n g   * *   ' '   +   @ N L   +  
                                           ' ' @ s u b s c r i b e r _ s e c u r i t y _ m o d e :   ' '   +   C A S T ( @ S u b s c r i b e r S e c u r i t y M o d e   A S   V A R C H A R ( 1 ) )   +   @ N L   +    
 	 	 	 	 	 	 	 ' ' @ s u b s c r i b e r _ l o g i n :   ' '   +   C A S E   W H E N   @ S u b s c r i b e r S e c u r i t y M o d e   =   1   T H E N   C O A L E S C E ( @ S u b s c r i b e r S Q L L o g i n ,   @ S u b s c r i b e r W i n d o w s L o g i n ,   ' ' S Q L A g e n t S e r v i c e A c c o u n t ' ' )   E L S E   C O A L E S C E ( @ S u b s c r i b e r S Q L L o g i n ,   ' ' N U L L   ( C o n n e c t i o n   t o   s u b s c r i b e r   w i l l   f a i l ) ' ' )   E N D   +   @ N L   +    
 	 	 	 	 	 	 	 ' ' @ s u b s c r i b e r _ p a s s w o r d :   ' '   +   C A S E   W H E N   @ S u b s c r i b e r S e c u r i t y M o d e   =   1   T H E N   C O A L E S C E ( @ S u b s c r i b e r S Q L P w d ,   @ S u b s c r i b e r W i n d o w s P w d ,   ' ' S Q L A g e n t S e r v i c e A c c o u n t ' ' )   E L S E   C O A L E S C E ( @ S u b s c r i b e r S Q L P w d ,   ' ' N U L L   ( C o n n e c t i o n   t o   s u b s c r i b e r   w i l l   f a i l ) ' ' )   E N D   +   @ N L   +   @ N L   +  
                                           ' ' * *   W i l l   a t t e m p t   t o   r u n   t h e   S Q L   A g e n t   d i s t r i b u t i o n   j o b   u s i n g   * * ' '   +   @ N L   +  
 	 	 	 	 	 	 	 ' ' @ j o b _ l o g i n :   ' '   +   C O A L E S C E ( @ S u b s c r i b e r W i n d o w s L o g i n ,   ' ' S Q L A g e n t S e r v i c e A c c o u n t ' ' )   +   @ N L   +    
 	 	 	 	 	 	 	 ' ' @ j o b _ p a s s w o r d :   ' '   +   C O A L E S C E ( @ S u b s c r i b e r W i n d o w s P w d ,   ' ' S Q L A g e n t S e r v i c e A c c o u n t ' ' )  
                    
                   R A I S E R R O R ( @ S u b M s g ,   0 , 1 )   W I T H   N O W A I T  
  
  
 	 	 	 - -   A d d   t h e   s u b s c r i p t i o n   a g e n t  
 	 	 	 E X E C   s p _ a d d p u s h s u b s c r i p t i o n _ a g e n t    
 	 	 	 	 	 	 	 	 @ p u b l i c a t i o n   =   @ P u b l i c a t i o n N a m e ,    
 	 	 	 	 	 	 	 	 @ s u b s c r i b e r   =   @ S u b s c r i b e r S e r v e r ,    
 	 	 	 	 	 	 	 	 @ s u b s c r i b e r _ d b   =   @ D e s t i n a t i o n D b ,    
 	 	 	 	 	 	 	 	 @ j o b _ l o g i n   =   @ S u b s c r i b e r W i n d o w s L o g i n ,    
 	 	 	 	 	 	 	 	 @ j o b _ p a s s w o r d   =   @ S u b s c r i b e r W i n d o w s P w d ,    
 	 	 	 	 	 	 	 	 @ s u b s c r i b e r _ s e c u r i t y _ m o d e   =   @ S u b s c r i b e r S e c u r i t y M o d e ,    
 	 	 	 	 	 	 	 	 @ s u b s c r i b e r _ l o g i n   =   @ S u b s c r i b e r S Q L L o g i n ,  
 	 	 	 	 	 	 	 	 @ s u b s c r i b e r _ p a s s w o r d   =   @ S u b s c r i b e r S Q L P w d ,  
 	 	 	 	 	 	 	 	 @ f r e q u e n c y _ t y p e   =   @ F r e q u e n c y T y p e ,    
 	 	 	 	 	 	 	 	 @ f r e q u e n c y _ i n t e r v a l   =   0 ,    
 	 	 	 	 	 	 	 	 @ f r e q u e n c y _ r e l a t i v e _ i n t e r v a l   =   0 ,    
 	 	 	 	 	 	 	 	 @ f r e q u e n c y _ r e c u r r e n c e _ f a c t o r   =   0 ,    
 	 	 	 	 	 	 	 	 @ f r e q u e n c y _ s u b d a y   =   0 ,    
 	 	 	 	 	 	 	 	 @ f r e q u e n c y _ s u b d a y _ i n t e r v a l   =   0 ,    
 	 	 	 	 	 	 	 	 @ a c t i v e _ s t a r t _ t i m e _ o f _ d a y   =   0 ,    
 	 	 	 	 	 	 	 	 @ a c t i v e _ e n d _ t i m e _ o f _ d a y   =   2 3 5 9 5 9 ,    
 	 	 	 	 	 	 	 	 @ a c t i v e _ s t a r t _ d a t e   =   2 0 0 7 0 1 2 2 ,  
 	 	 	 	 	 	 	 	 @ a c t i v e _ e n d _ d a t e   =   9 9 9 9 1 2 3 1 ,    
 	 	 	 	 	 	 	 	 @ e n a b l e d _ f o r _ s y n c m g r   =   N ' ' F a l s e ' ' ,    
 	 	 	 	 	 	 	 	 @ d t s _ p a c k a g e _ l o c a t i o n   =   N ' ' D i s t r i b u t o r ' '  
  
 	 	 	 S E T   @ S u b M s g   =   @ N L   +   ' ' S u b s c r i p t i o n   f o r   " ' '   +   @ P u b l i c a t i o n N a m e   +   ' ' "   a d d e d   t o   s u b s c r i b e r   " ' '   +   @ S u b s c r i b e r S e r v e r   +   ' ' " ' '  
 	 	 	 R A I S E R R O R ( @ S u b M s g ,   0 , 1 )   W I T H   N O W A I T  
 	 	 E N D  
 	 E L S E  
 	 	 B E G I N  
 	 	 	 S E T   @ S u b M s g   =   ' ' '   +   @ P u b l i c a t i o n N a m e   +   ' :   S u b s c r i p t i o n   t o   p u b l i c a t i o n   a l r e a d y   e x i s t s   f o r   s e r v e r   " '   +   @ S u b s c r i b e r S e r v e r   +   ' "   -   n o   a c t i o n   t a k e n . . . ' '  
 	 	 	 R A I S E R R O R ( @ S u b M s g ,   0 , 1 )   W I T H   N O W A I T  
 	 	 E N D  
 	  
  
 	 	 	 ' )  
 S E T   @ S u b C o u n t e r   =   @ S u b C o u n t e r   +   1  
 E N D 
