[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
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:
Just what I was looking for. Thanks for the tip.
thanks a lot. very useful
a good tip: the gift that keeps giving.. thanks. :-)
Thank you very much from Spain
Thanks!
Post a Comment
<< Home