I don't know the exact reason, but it seems to be based on the combination of the security option and the dynamic SQL when a different user calls the SP.
When you change SECURITY to OWNER and use "COLLECT STATS temp COLUMN name;" instead of sysexecsql it seems to work.
Dieter
I don't know the exact reason, but it seems to be based on the combination of the security option and the dynamic SQL when a different user calls the SP.
When you change SECURITY to OWNER and use "COLLECT STATS temp COLUMN name;" instead of sysexecsql it seems to work.
Dieter