Share via

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 | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories

0 comments No comments

2 answers

Sort by: Most helpful
  1. Olaf Helper 47,621 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.

    Was this answer helpful?


  2. Naomi Nosonovsky 8,906 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.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.