Complex Delete Scenarios

28 views
Skip to first unread message

Gavin Osborn

unread,
Nov 8, 2012, 10:27:52 PM11/8/12
to simpl...@googlegroups.com
Does Simple.Data support the following style query?

DELETE FROM Users
WHERE locationId IN
(
    SELECT locationid FROM Location WHERE continent = Europe
)

I've tried a few examples including:
db.Users.DeleteAll(db.Users.LocationId.IN(db.Locations.FindAllByContinent("Europe").Select(db.Location.LocationId)));

It's not throwing exceptions, but the SQL Server Profiler also tells me that it isn't executing any SQL either.

How would I best achieve this in Simple.Data?

Cheers,

ma...@markrendle.net

unread,
Nov 9, 2012, 5:06:51 AM11/9/12
to simpl...@googlegroups.com
Hey Gav,
 
No, that's not supported yet, I'm planning to do some work on compound operations like that in 2.0, which is probably starting in earnest around the end of the year.
 
In the meantime, stored procs are my catch-all work-around recommendation. 😊

Cheers,
Mark
 
Sent from Windows Mail
 
Reply all
Reply to author
Forward
0 new messages