Alex & Access

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

About Me Search
My Photo
Name:Alex Dybenko

Location:Moscow, Russia
Google
 
Web AccessBlog.net

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

3 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  

Post a Comment

Links to this post:

Create a Link

<< Home