Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        
            
                
                    
                        
                            
                                | Author | 
                                
                                 Topic  | 
                             
                            
                                    | 
                                         lholden 
                                        Starting Member 
                                         
                                        
                                        5 Posts  | 
                                        
                                        
                                            
                                            
                                             Posted - 2008-05-16 : 05:08:31
                                            
  | 
                                             
                                            
                                            | I have written a table function, that returns data through the IEmunerator.If add a distinct clause to my T-SQL select statement:select distinct a,bfrom tableFunc()where does the distinct get executed?Does it resolve the enumeration back to sql memory and then call the distinct?does it/ can it do something clever and pass the distinction back to the enumerator?Would there be (in general) any benift/performance gain in pulling the data back to a temp table first and then issuing the distinct over the temp table?cheerslee | 
                                             
                                         
                                     | 
                             
       
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |