Are there any gotchas or good reasons not to use autosproc for stored procedure calls?

孤者浪人 提交于 2019-12-11 06:14:38

问题


I've implemented a data access layer that populates generic entities from a datareader using a variation of the third monkey approach (http://www.codeproject.com/KB/database/DynamicMethod_ILGenerator.aspx). This works well, performs well and saves me writing loads of repetetive code for data retrieval.

Now I want to add methods that take a generic entity and convert it to a parameter list for feeding to a stored proc so that I can add data persistence to my monkey's trick collection.

I found some guidance at: http://msdn.microsoft.com/en-us/library/ms973259.aspx and some sample code in the autosproc solution. It looks good on paper and I intend to incorporate this but a quick google did not turn up much in the way of user experiences of implementing autosproc and I am looking for a thumbs up (or down) from anyone who has been there and done that already.

So, have you used autosproc? Did it work well for you? Are there any gaping flaws in performance or elsewhere that would make it unsuitable in an enterprise application?

Advice appreciated.


回答1:


I think it's easier to refer you to this question, where my answer contains links to your AutoSproc thing: TSQL - Parse Execution Plan to determine columns to be returned by a stored procedure

To summarise, I didn't like it: it caused too many issues.

(Just poking around unanswered questions and found this one)



来源:https://stackoverflow.com/questions/626933/are-there-any-gotchas-or-good-reasons-not-to-use-autosproc-for-stored-procedure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!