• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 658
  • Last Modified:

SQL Server 2008 - Permission Issue

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
0
escheider
Asked:
escheider
  • 2
1 Solution
 
escheiderAuthor Commented:
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.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
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'
AS
SELECT columnName FROM tableName
GO

Open in new window

0
 
escheiderAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now