TRUNCATE TABLE – Generates error “Cannot find object * because it does not exist or you do not have permission”

 
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
 
 
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: