sqlsql-serverquery-performancewith-statementwith-clause

SQL Server 2008 - With Clause


In the Oracle database we had extensively used WITH clause in earlier project.

Now we are on SQL Server 2008 database. Do you suggest we can still use the WITH Clause in our SQL codes ? Does SQL Server 2008 support WITH clause ?

I mean does it improve the performance or does using WITH affect query performance in SQL Server 2008 ?


Solution

  • You can read more about it here:

    https://learn.microsoft.com/en-us/sql/t-sql/queries/with-common-table-expression-transact-sql

    and here:

    https://learn.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table

    Depending on what it is you were specifically looking at.

    Performance is very much dependent on what it is you are doing, you would need to post some examples.