If a DBA has the power to decide for you how you write your software, then there's not much we can do, I'm afraid. Convincing DBA's that procs aren't an advantage is an uphill battle. For example, the 2 most heard myths from DBAs that procs are better are:
1) procs are more secure
2) procs are faster.
1) Take an application X. X is used by Joe from accounting. Say, X uses stored procedures and as Joe works on his laptop, it's apparent that X uses some sort of user to login to the db system. Say Joe is allowed to remove customers, within the context of the app. Is Joe then also able to do that if he connects with a query tool to the db using the exact same credentials as the application uses? Yes:
the proc pr_DeleteCustomer(@customerID) can be called by Joe with the query:
EXEC pr_DeleteCustomer(10)
and customer 10 is gone. Security set on procs can also be done with roles on tables. It's also very little work to do and gives you the same security level.
2) the myth that procs are faster comes from the fact that people think that procs are stored in pre-compiled form. That's not true, at least not in modern database systems: they're compiled when they're first ran, the execution plan is cached, and if the cache decides the execution plan has to go, it's tossed away and the proc will be re-compiled the next time it's run. This is exactly the same as with dyn. parameterized sql.
Gazley wrote:
- Convice the DBA's that there is no "technical" advantage to SProcs.
Other than its massively easier to tie down security <shrug>. I would say this is a technical advantage but hey, what do I know?
no it's not 'easier'. You can also define roles on your schema, and place users in those rules, where they get the credentials of the role.
The problem with the 'it's more secure'-myth is that people forget that the application isn't written by the DBA. So the application developer has several DML actions to execute, however it's undecided whether the developer is able to do so, because of the procs available. This thus leads to proc-addition to fulfil the request of the developer. However, the security that should be applied to the proc depends on the context the proc is used in. That's not determinable at a static level. What IS determinable is that you can determine the rights on the data at the set /relational algebra level.
- Use a tool other than LLBLGen.
So, the real answer is, there isn't a way or an easy way to do this, other than possibly use SQL Server 2005 and restrict access via the application rather than the user.
Correct, together with role based security on the server.