Permission for Truncate Statment

  • Developers had designed a SP in which nearly 5 tables have to be truncated at the runtime, for security reason I am asking them to convert the truncate to delete, on other hand it will hinder the performance. Is there any alternate?

    ---------------------------------------------------
    Thanks,
    Satheesh.

  • What are you using to execute the stored procedure? Is this part of a job or an application? Curious.

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • If it is a Job, then it should not be an issue. You dont have to give extra rights to the app user. If it is the App User, maybr you can look at "execute as "

    -Roy

  • one way is to create a database user that is not mapped to a sql login but has alter permissions on the tables to truncate. When the devs execute use the context of the database user. Check BOl for more details

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • It's for an application.

    ---------------------------------------------------
    Thanks,
    Satheesh.

  • And Stored Proc's are schema authenticated and I had provide only execute permission on the schema.

    ---------------------------------------------------
    Thanks,
    Satheesh.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply