none
Using SQL Functions VS. Stored Procedures for WCF-SQL and how to use ORDER BY on Function RRS feed

  • Question

  • Two questions:

    1. If using the WCF-SQL adapter to get data from the database (strictly just select statements, no Inserts/Updates), should I use Stored Procedures or table valued functions? I like the flexibility of stored procedures but looking online, it appears that if not inserting/updating or doing any logic, functions should be used. What is recommended?

    2. If using functions, how do we perform the outer select when an 'order by' is needed? It does not say in the article Invoke Table-Valued Functions in SQL Server using BizTalk Server


    • Edited by Malisk Tuesday, May 29, 2018 11:00 AM spelling
    Tuesday, May 29, 2018 11:00 AM

All replies

  • Always use Stored Procedures.

    It's the simplest advice and using Stored Procedures is effectively never the wrong choice.

    Tuesday, May 29, 2018 4:23 PM
  • Stored Procedure is the best and always recommended option. Personally I always use Stored Procedures all the time.

    Mandar Dharmadhikari

    Wednesday, May 30, 2018 8:16 AM