Calling a stored procedure from trigger

Adeel Mirza 121 Reputation points
2022-03-31T12:11:06.09+00:00

I have a requirement, where the user selects a date from the form and on that date a trigger should be fired that will update a table.
Is it feasible? If yes how can I accomplish it?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
11,550 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Naomi 7,361 Reputation points
    2022-03-31T13:20:25.513+00:00

    Can you elaborate on your environment? You need some sort of a service to be running or you may want to use a SQL Server job.


  2. Olaf Helper 35,846 Reputation points
    2022-04-01T06:35:38.597+00:00

    So I was wondering if I can create SQL Trigger that calls the stored procedure to update on that particular date

    Do you mean a DML trigger on a database table like https://learn.microsoft.com/en-us/sql/relational-databases/triggers/dml-triggers?view=sql-server-ver15
    Don't make much sense.

    Better your ASP.NET backend execute the stored procedure directly passing the selected date as parameter.