Use SQL View or SQL Query?

前端 未结 9 1243
旧巷少年郎
旧巷少年郎 2021-01-17 22:46

I am working on an application to get data from a MS-SQL server (2005). In the command text, I can pass a sql query like this:

string query = \"SELECT T1.f1,         


        
9条回答
  •  再見小時候
    2021-01-17 23:19

    Or you could use a stored procedure. Using a stored proc will allow SQL to cache the execution plan. I think the same is true of a view. Your first method (ad-hoc query) will probably be the least efficient.

提交回复
热议问题