This is generally harder to pull off though unless you do things like force all DB access to go through stored procedures.
And then you're really still pursuing the same strategy described above, except for your stored procedures instead of your app code.