• Luis Cazares (6/28/2013)


    Ok, won't argue on this, but will definitively search on why I was told that.

    EDIT: I believe they told me to change a non-clustered index (only index on a heap) to a clustered index and then use an order by and a dbcc traceon(610) to have minimally logged inserts. (I'm not sure it's a good practice even if the advice was given by a Microsoft consultant.)

    I'm not sure about how it would play in older versions of SQL Server. As for now, mimimal logging for INSERT INTO, according to MS (http://msdn.microsoft.com/en-us/library/ms174335(v=sql.105).aspx) could be achieved by:

    Using INSERT INTO…SELECT to Bulk Import Data with Minimal Logging

    You can use INSERT INTO <target_table> SELECT <columns> FROM <source_table> to efficiently transfer a large number of rows from one table, such as a staging table, to another table with minimal logging. Minimal logging can improve the performance of the statement and reduce the possibility of the operation filling the available transaction log space during the transaction.

    Minimal logging for this statement has the following requirements:

    •The recovery model of the database is set to simple or bulk-logged.

    •The target table is empty or is a nonempty heap.

    •The target table is not used in replication.

    •The TABLOCK hint is specified for the target table.

    Rows that are inserted into a heap as the result of an insert action in a MERGE statement may also be minimally logged.

    ...

    I'm not aware of anything else which can make INSERT INTO "less logged"

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]