• what would happen if your procedure received NULL for either of the two parameters? could it raise an error?

    exec [sp_ETL_To_Rpt] @frmdt,@todt

    since your trigger says it's also for DELETE, and you are only assigning variables from the INSERTED table, that would happen in at least one scenario; it also depends on your data; are you sure the two values receive a value in the isnert or update?

    also, technically INSERTED might have more than one row, and you are assigning the values to your local params from what could be a collection of values...does it matter to your business model? or does the business always insert,update or delete only a single row at a time?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!