SQL Server 2008 - Permission Issue

Posted on 2012-09-11
Last Modified: 2012-09-21
Good evening experts:

I'm having some issues with what appears to be permission issues while attempting to insert records from a .NET application.  The strange this with this issue is that it is limited to two specific tables, and only occurs when inserting records.

Using the same user credentials, I have no issue with inserting data into many of the other tables utilized in the .net application.

When attempting to execute the INSERT stored procedure, I receive the following exception:

Cannot find the object 'tblVendor' because it does not exist or you do not have permissions.

If I execute a SELECT query against tblVendor with the same credentials, I am able to retrieve all the records from this table.

This situation applies to two tables in the database, and any help would be much appreciated.

Using SQL SERVER 2008 R2
Question by:escheider
    LVL 4

    Author Comment

    okay .. just narrowed it down .. the two stored procedures I am attempting to execute truncate the table before inserting records ..

    So evidently, the account must have the ability to truncate the tables.
    LVL 44

    Accepted Solution

    For TRUNCATE TABLE operations you need to give ALTER TABLE permission to user.
    If you don't want to give that permission, you can create stored procedure with EXECUTE AS clause:
    CREATE PROCEDURE dbo.usp_Example
    WITH EXECUTE AS 'MyDomain\UserDBO'
    SELECT columnName FROM tableName

    Open in new window

    LVL 4

    Author Closing Comment

    apologize for the delay .. it was a few weeks before I was able to get back to the client.   Appreciate the input .. this takes care of the problem.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
    There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now