Hi. I have written a persistence layer which maps an action on an object to a stored procedure eg. calling Save on an object will call then spSaveObject proc populating the correct parameters with members of the object and filling the members with any data returned. I've been reading up on OR mappings to see if I can improve my layer and most of the articles recommend that the mapping layer creates dynamic SQL for each action and executes it directly on the tables involved. I can see a lot of advantages to this approach, the most obvious being not having to maintain stored procs. However, this approach also bypasses one of the main reasons for using stored procs, namely security. The application user will have access to the full set of data in the tables. Not through the application of course but a connection directly to the database by a malign (or just nosey) user could cause havoc. Am I wrong worrying about this? Should I assume that security policies in the enterprise will not allow this to happen? Is dynamic SQL once again acceptable?
Durkin
Durkin