Pregunta

Error Message: The SELECT permissions was denied on the object 'quote', database 'oneview', schema 'dbo'.

I am relatively new to SQL and the developer I am learning from is only part time and very hard to get a hold of unfortunately. Can anyone help me understand what is wrong with the Query below and suggest any fixes that might be needed?

SELECT     licenseEntitlement.entID, licenseEntitlement.entStartDate, licenseEntitlement.entEndDate, quote.quoteId, quote.accountId, quote.clientId, 
                      quote.clientName, quote.contactName, quote.contactEmail, quote.extReference, quote.purchaseOrderNumber, quote.linkedTicket
FROM         licenseEntitlement INNER JOIN
                      quote ON quote.quoteId = SUBSTRING(licenseEntitlement.entComments, 12, PATINDEX('% Created%', licenseEntitlement.entComments) - 12)
WHERE     (licenseEntitlement.entType = 'AVS') AND (licenseEntitlement.entComments LIKE 'OV Order + %') AND (licenseEntitlement.entEndDate < '7/1/2014')
ORDER BY licenseEntitlement.entEndDate

No hay solución correcta

Otros consejos

You need to give the user in question rights to SELECT from those table(s).

It is nothing to do with your query itself (given the right permissions)

However, you should be looking into Stored Procedures and giving permissions to that instead of direct access to the tables.

Your user doesnt have select permission on table

give either select permission or db_readonly to user

Execute the following statement to give user the appropirate permission

GRANT SELECT ON [dbo].[quote] TO [Domain\User]  --<-- User's UserName
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top