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