You need to use the SQL Server Agent installed as part of SQL Server. This is a help desk that is responsible for performing scheduled maintenance and backup tasks.
Expand the SQL Server node agent in SQL Server Management Studio, you will see a node tree called "Jobs"
When you right-click, this will give you the opportunity to add a new task. Tasks consist of a sequence of steps that must be performed in order, and when you add a new step to your task, you can select various types of steps, including "Transact-SQL Script"
Create a new task, add one T-SQL step, place the queries you want to run in the properties of the step, and then use the Schedule parameter in the task properties to create a repeating schedule that will run every 24 hours (or every time )
source share