AccessBlog.net

News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Alex
Name:Alex Dybenko

Location:Moscow, Russia

Friday, October 22, 2004

[Access] Delete & Update SQL in Jet

Discussion in newsgroups remembered me a old Jet trick. Say you made a join on 2 tables and want to delete records from one. In TSQL you can explicit specify this as:

Delete From Table1
From Table1 inner join Table2

But in jet this will not work. What you have to do - is to specify table you want to delete using DISTINCTROW keyword:

Delete DISTINCTROW Table1.* From Table1 inner join Table2

Good explanation together with links to Microsoft KB is here: http://www.mvps.org/access/queries/qry0022.htm

5 Comments:

Anonymous Anonymous said...

Just what I was looking for. Thanks for the tip.

9:46 PM  
Anonymous Anonymous said...

thanks a lot. very useful

4:32 PM  
Anonymous Anonymous said...

a good tip: the gift that keeps giving.. thanks. :-)

11:31 AM  
Anonymous Anonymous said...

Thank you very much from Spain

1:51 PM  
Anonymous Anonymous said...

Thanks!

4:24 AM  

Post a Comment

<< Home