Does writing a stored procedure into, say, MS SQL Server 2000, and then executing the stored procedure from a programming language code yield an advantage over composing an SQL query from the programming language code and then firing the query from the programming language code?