How to restrict deletion of specific row of SQL server table I want to restrict deletion of specific row. For example if someone wants to truncate a table or delete all the records from table then an error message should be thrown, for particular id it is not allowed. I have used trigger for the same but it is of no use, as it does not fire at truncate

Create TRIGGER vendorTrigger
    ON [Vendor]
    INSTEAD OF DELETE
AS
    IF EXISTS(SELECT * FROM Vendor WHERE VendorId = 515)
    BEGIN
        RAISERROR ('Is not allowed to delete VendorId: 515 as it is of type corpnet',16, 1)  
    END
    ELSE
    BEGIN
       Delete from Vendor Where VendorId in (Select VendorId From Vendor)
    END
TRUNCATE TABLE requires ALTER permission on the table. 
The best way to prevent truncating a table is to revoke that permission. 

What’s more TRUNCATE TABLE cannot activate a trigger because the operation does not log individual row deletions.

See more on TRUNCATE TABLE (Transact-SQL)