• After laboring on this problem for 5 days, and some Googling, I finally found the solution myself.

    The first problem was on account of my lack of understanding of triggers and how they fire. As per SQL documentation,

    "SQL Server triggers fire only once per statement, not once per affected row".

    Due to this design principle, when in Step 5, I do a bulk Insert from the PriceData table into the FruitTrades table, the trigger is fired only once, instead of once for each row. Hence the Updated values are incorrect.

    The VolTrendPrevD remains null because the Select statement for it in the Update trigger always matches the first row in the FruitTrades table (since the Inserted table has multiple rows) and for this row, the VolTrend is null.

    The TAID remains null because VolTrendPrevD is null.

    Now the fix:

    1. Import the text file containing the price data into a MSaccess table. From there do a bulk insert in to the SQL Server table (using Linked tables). This approach uses ODBC to convert the bulk insert into multiple single inserts, thus bypassing the first problem.

    2. Convert the VolTrend into a computed column. There is no need to update it therefore in the trigger.

    3. Introduce an additional column PricePrevD in the FruitTrades table and update its value in the trigger, in the same manner as the VolTrendPrevD column.

    4. Most importantly, ensure that the inserted rows from Access are inserted in ascending order by date (by creating an appropriate date index in Access). Else the desired results will be missing.

    Hope this helps... 🙂