Claudio Devecchi · Jul 7, 2016

get DocumentId column from DocDM

Does anybody know how can I get the DocumentId property from a DocDM repository using SQL?. So far my SQL is like this:

SELECT name,email,gender FROM JSON_TABLE(
  '$' COLUMNS(
    name VARCHAR(100) PATH '$.name',
    email VARCHAR(100) PATH '$.email',
    gender VARCHAR(2) PATH '$.gender'


0 294
Discussion (2)1
Log in or sign up to continue

The document ID is exposed implicitly as a virtual column named "_documentID". Here is a simple example that you can run in your SAMPLES namespace:

SELECT _documentID, Name, DOB, SSN FROM JSON_TABLE('People','$' %TYPE 'Sample.Document.People')