April 28, 2010 at 3:17 am
Hi Experts,
I have a small doubt regarding the permission ALTER.
By giving this we can truncate a table but we cant delete..Considering the security issues i think TRUNCATE is serious as its a no logged operation.
My doubt is why sql allowing truncate in ALTER and not delete.
Please Help
TIA
April 28, 2010 at 4:12 am
Ratheesh.K.Nair (4/28/2010)
Considering the security issues i think TRUNCATE is
Truncate is minimally logged operation. Rows affected by truncate operations are not logged, however, the log contains info that a particular table was truncated.
April 28, 2010 at 5:33 am
Thanks Pradeep..
Can you please let me know why like this?? I wonder why Truncate remove all data which cannot be rolled back with just an ALTER PERMISSION
TIA
April 28, 2010 at 6:19 am
Check out this QOTD, also check out the discussion that follows, all your questions will be answered there :
http://www.sqlservercentral.com/questions/T-SQL/69738/
http://www.sqlservercentral.com/Forums/Topic908285-1198-1.aspx
April 28, 2010 at 6:33 am
Thanks Ninja,
So TRUNCATE and DELETE are almost same then why its like TRUNCATE can be done by using an ALTER permission where as DELETE cannot and need specific permission?
April 28, 2010 at 6:36 am
I can't tell you specifically why truncate is allowed and not delete when you give the alter permission, but you're wrong about rollbacks. Truncate can be rolled back.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 28, 2010 at 9:19 am
Grant Fritchey (4/28/2010)
I can't tell you specifically why truncate is allowed and not delete when you give the alter permission, but you're wrong about rollbacks. Truncate can be rolled back.
This could be attributed to granulity. Give the least amount of permissions to any user. You may need to be able to truncate a table to reload it from another environement. But without being allowed to delete 1 single row because you need to have both tables perfectly identical.
April 28, 2010 at 9:40 am
Truncate is generally more efiicient when clearing the whole table and unlike delete will reset any seed value as well!
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
April 28, 2010 at 11:07 am
Ninja's_RGR'us (4/28/2010)
Grant Fritchey (4/28/2010)
I can't tell you specifically why truncate is allowed and not delete when you give the alter permission, but you're wrong about rollbacks. Truncate can be rolled back.This could be attributed to granulity. Give the least amount of permissions to any user. You may need to be able to truncate a table to reload it from another environement. But without being allowed to delete 1 single row because you need to have both tables perfectly identical.
Yeah, it makes a sort of sense. It is much more of an administrative task, when looked at right, and much less about manipulating data. Partly because it's so complete.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 28, 2010 at 11:24 pm
Thanks Everyone ..
but wat abt data security..
April 29, 2010 at 5:21 am
Has nothing to do with truncate or delete... if the user shouldn't have access to the data, then don't grant it.
April 29, 2010 at 11:41 pm
I am with Ninja
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply