TRUNCATE TABLE – Generates error “Cannot find object * because it does not exist or you do not have permission”
18-Aug-0909 Leave a comment
Generates error
cannot find the object "%.*ls" because it does not exist or you do not have permissions.
TRUNCATE needs higher permission than DELETE FROM
Needs Alter control on table. This may be too high for entire schema and may really be too high for object.
So workarounds are:-
Use WITH EXECUTE AS SELF
AS SELF means execute as the person who created the s.p
http://msdn.microsoft.com/en-us/library/ms177570.aspx – See permissions in this article
ALSO as a secondary note on TRUNCATE TABLE.
Truncate is not allowed if there are any Foreign Keys on the table
Steve