I am in the process of giving one of the company's web apps a revamp. I will use ASP.Net MVC for the user interface and MS SQL Server for the back-end.
I busy with the optimization of a database, which includes its stored procedures and triggers.
- What is the best practice with reference to the use of triggers and stored procedures?
- Should most or all of the T-SQL be in stored procedures and the execution of the stored procedure triggered by the triggers; or should the T-SQL be in the triggers?
- How is the speed of T-SQL affected through the use of stored procedures in triggers?
I appreciate any advice I can get.
Basil HowitsonPosted Jul 4, 2016, 4:07 AM
Thank you for the advice Dharmesh.
I have limited my trigger to execute only against the record with a PrimaryID thathas been inserted or updated.Should I split my triggers? For example, one trigger to target inserts and another trigger to target updates.
Dharmesh SinghPosted Jul 3, 2016, 8:57 AM