Direct sql query execution vs keeping it inside procedure

Database
Enthusiast

Direct sql query execution vs keeping it inside procedure

Hi Guys,

Just noticed one thing. There is a sql query having executed for date range with local variables defined inside a procedure. For this, CPU cycles coming much high compared to the execution of same sql query manually with hardcoding date range. What does it imply? And am super curious to know what is the reason behind this.

your inputs are a lot to me 

Thanks,

Mahesh.