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 |  
                                    | glenharvyStarting Member
 
 
                                        5 Posts | 
                                            
                                            |  Posted - 2007-05-28 : 09:03:40 
 |  
                                            | Hi,The following works in SQL 2005 but NOT SQL 2005 Compact Edition:IF EXISTS (SELECT ID FROM Court2 WHERE BookingDate = '2007-05-28')UPDATE Court2 SET T1100 = 52 WHERE (BookingDate = '2007-05-28')ELSEINSERT INTO Court2 (BookingDate,T1100) VALUES ('2007-05-28',52)In CE I get the following error:There was an error parsing the query. [ Token line number = 1,Token line offset = 1,Token in error = IF ]I can't find where the problem is - can someone help.Thanks, |  |  
                                    | harsh_athalyeMaster Smack Fu Yak Hacker
 
 
                                    5581 Posts | 
                                        
                                          |  Posted - 2007-05-28 : 09:10:57 
 |  
                                          | Is this the first statement in the SP/Script or there are some statements before IF EXISTS() as well? If yes, then post them too.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |  
                                          |  |  |  
                                    | khtanIn (Som, Ni, Yak)
 
 
                                    17689 Posts | 
                                        
                                          |  Posted - 2007-05-28 : 09:17:14 
 |  
                                          | Is IF ... ELSE supported in SQL 2005 CE ? KH
 |  
                                          |  |  |  
                                    | glenharvyStarting Member
 
 
                                    5 Posts | 
                                        
                                          |  Posted - 2007-05-28 : 09:20:08 
 |  
                                          | There is nothing else - I'm actually running the statement in SQL Management Studio. |  
                                          |  |  |  
                                    | glenharvyStarting Member
 
 
                                    5 Posts | 
                                        
                                          |  Posted - 2007-05-28 : 09:49:02 
 |  
                                          | quote:Is IF ... ELSE called scripting?If so then I don't think its supportedOriginally posted by khtan
 Is IF ... ELSE supported in SQL 2005 CE ?
 KH
 
   |  
                                          |  |  |  
                                    | khtanIn (Som, Ni, Yak)
 
 
                                    17689 Posts | 
                                        
                                          |  Posted - 2007-05-28 : 09:51:23 
 |  
                                          | As far as i know it is not supported in SQL Server CE 2.0 so don't think it will be supported in 2005 Compact Edition also. KH
 |  
                                          |  |  |  
                                |  |  |  |