• Not sure why it doesn't work. What if you put the code in a stored procedure and you call that sp with the OLE DB command?

    On a sidenote: the OLE DB command is really slow for larger data sets. Consider writing your updates to a staging table and then do a regulare UPDATE statement.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP