• Hi Solomon,

    Sorry that I had to get to do a lot of other tasks, could get back to this only today. Thank you for the explanation and the suggestions.

    I overloaded the SqlFunction to take SqlDateTime and return SqlDateTime, used IsDeterministic=true and am setting PERMISSION_SET to SAFE and back to UNSAFE again.. The memory still is not being cleared..

    I do generate the update script for each table and execute from a C# console application. However, at some point during execution when the table is too huge, the memory usage shot up to 99% and never came down.. everything slowed down and after an hour I had to restart the machine.

    Is there anything else that I could be missing? I'm considering stopping and starting SQL SERVER service from the C# application, which I know could be dirty.. Please let me know, if something better could be done.

    Thank you

    RPS