Why were functions introduced when stored procedures were already available in SQL Server?
What factors led to the introduction of functions alongside stored procedures in SQL, and how do functions specifically enhance the flexibility and efficiency of database operations compared to stored procedures?