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  | 
                             
                            
                                    | 
                                         danasegarane76 
                                        Posting Yak  Master 
                                         
                                        
                                        242 Posts  | 
                                        
                                        
                                            
                                            
                                             Posted - 2015-03-06 : 02:37:29
                                            
  | 
                                             
                                            
                                            Hi All,     I have UDF function that returns 0,1 and I wish to use this function as in a PROC If fn_test(10) Then    SET @Name = 'TEST' But it says quote: An expression of non-boolean type specified in a context where a condition is expected, near 'SET'.
  What I am missing here? | 
                                             
                                         
                                     | 
                             
       
                            
                       
                          
                            
                                    | 
                                     SwePeso 
                                    Patron Saint of Lost Yaks 
                                     
                                    
                                    30421 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2015-03-06 : 03:00:41
                                          
  | 
                                         
                                        
                                          IF fn_test(10) = "WHAT? "     set @name = 'test'; Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     danasegarane76 
                                    Posting Yak  Master 
                                     
                                    
                                    242 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2015-03-06 : 03:13:30
                                          
  | 
                                         
                                        
                                          | Thanks that worked  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |