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  | 
                             
                            
                                    | 
                                         robertnzana 
                                        Starting Member 
                                         
                                        
                                        42 Posts  | 
                                        
                                        
                                            
                                            
                                             Posted - 2008-05-20 : 11:13:11
                                            
  | 
                                             
                                            
                                            | I have an Access db that has 1 "local" table and 1 LINKED SQL Server table.  I am can manually add data to the LINKED table, but when I try to delete it by a DELETE query I get "Records not deleted. Data is read-only."  But, I CAN delete a record manually.Any ideas what's going on?  I'm linked to the SQL Server table as 'sa'.Thanks. | 
                                             
                                         
                                     | 
                             
       
                            
                       
                          
                            
                                    | 
                                     AndrewMurphy 
                                    Master Smack Fu Yak Hacker 
                                     
                                    
                                    2916 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2008-05-20 : 11:23:26
                                          
  | 
                                         
                                        
                                          | does your table have a primary key?  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     robertnzana 
                                    Starting Member 
                                     
                                    
                                    42 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2008-05-20 : 11:24:32
                                          
  | 
                                         
                                        
                                          | the table that i want to delete from (link SQL server table) DOES have a pk...  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     robertnzana 
                                    Starting Member 
                                     
                                    
                                    42 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2008-05-20 : 11:27:05
                                          
  | 
                                         
                                        
                                          | Is it allowable to do something like this? What's teh correct syntax...DELETE FROM dbo_USGSEmployees LEFT JOIN [Emergency Roster USGS 2008-10] ON (dbo_USGSEmployees.EmployeeName = [Emergency Roster USGS 2008-10].Name) AND (dbo_USGSEmployees.City = [Emergency Roster USGS 2008-10].[Duty Station City Desc])WHERE ((([Emergency Roster USGS 2008-10].Name) Is Null) AND (([Emergency Roster USGS 2008-10].[Duty Station City Desc]) Is Null));I want to delete from the dbo_USGSEmployees table, but use the joins as well.  Any ideas????  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     AndrewMurphy 
                                    Master Smack Fu Yak Hacker 
                                     
                                    
                                    2916 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2008-05-21 : 07:09:31
                                          
  | 
                                         
                                        
                                          | in regular SQL (not the MS Access product) you can do this sort of thing.DELETE dbo_USGSEmployeesFROM dbo_USGSEmployees LEFT JOIN [Emergency Roster USGS 2008-10] ON (dbo_USGSEmployees.EmployeeName = [Emergency Roster USGS 2008-10].Name) AND (dbo_USGSEmployees.City = [Emergency Roster USGS 2008-10].[Duty Station City Desc])WHERE ((([Emergency Roster USGS 2008-10].Name) Is Null) AND (([Emergency Roster USGS 2008-10].[Duty Station City Desc]) Is Null));The 2 x "IS NULL" statements are overkill, just one should do.  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     robertnzana 
                                    Starting Member 
                                     
                                    
                                    42 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2008-05-24 : 17:09:15
                                          
  | 
                                         
                                        
                                          | thanks  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |