Hi,
I'm designing a new application using a sql server backend. The application will basically integrate data from different departments.
I am investing some time to design one main form where users can view data about every thing. Basiclly with a tree view on the left listing all departmetns and objects they need.
I want to build a generic search module that I will be able to use for all objects (tables).
For example, consider a table (tblPerson), you can search a table either by a Descriptive field (PersonName) a Foriegn Key (CompanyID,AddressID) or a PrimaryKey (PersonID).
I am thinking of building a stored procedure that will accept the field you are searching and the table name and then dynamicall build the sql statment.
The pros is obvious : Cleaner Code, better maintenance, REUSE and efficiency
The Cons:
I have to manage the permission on a table level vs Stored procedure level
and my main concern is that : i don't know how it will effect the performance if I use sql statments vs stored procedures (regarding the execution plans and the fact that stored procedures sit in memory)?
Any ideas?
Thanks
I'm designing a new application using a sql server backend. The application will basically integrate data from different departments.
I am investing some time to design one main form where users can view data about every thing. Basiclly with a tree view on the left listing all departmetns and objects they need.
I want to build a generic search module that I will be able to use for all objects (tables).
For example, consider a table (tblPerson), you can search a table either by a Descriptive field (PersonName) a Foriegn Key (CompanyID,AddressID) or a PrimaryKey (PersonID).
I am thinking of building a stored procedure that will accept the field you are searching and the table name and then dynamicall build the sql statment.
The pros is obvious : Cleaner Code, better maintenance, REUSE and efficiency
The Cons:
I have to manage the permission on a table level vs Stored procedure level
and my main concern is that : i don't know how it will effect the performance if I use sql statments vs stored procedures (regarding the execution plans and the fact that stored procedures sit in memory)?
Any ideas?
Thanks