June 25, 2009 at 11:52 am
I had someone in the db_datareader role come to me and say that he did not have permission to run a xquery select statement; he obviously can run a regular TSQL select statement. I guess I don't really understand the difference between the two - I don't know what internal things must happen to query/select xml. Therefore, I don't know what permission I need to grant to this user so he could run his xquery selects. Any help figuring this out would be greatly appreciated. Thanks in advance - I'm new to xqueries.
June 25, 2009 at 1:29 pm
Can you provide some structures and a sample query? I believe that the db_datareader role should be able to query xml columns.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
June 25, 2009 at 1:38 pm
Here's the basic structure of the query:
SELECT [COLUMNA]
,[COLUMNB]
,[COLUMNC]
FROM [DatabaseName].[Schema].[Table]
where ColumnC.value('(/Something/Something/Something/Something)[1]','nvarchar(30)')='OOO 0000000-00'
Does that help at all??
June 25, 2009 at 2:23 pm
Is there an error regarding permissions being returned or is there just no data being returned? I have done some testing and a database user in the db_datareader role can query an xml column using XQuery syntax. Are you sure the XQuery sytax is correct? What happens if you run the query in development with the XQuery in the select list instead of the where clause?
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply