First off, I'd like to say that I understand the limitations and the risk of accessing a Sharepoint Database directly. I am not updating the SP Content, just simply querying the data in a SQL View for another application.
Generally, when I need to create a view for SP data I have had to manually map the List/Library fields to their dynamic database columns. However, this can get fairly tedious depending on the size of the list. For example:
- nvarchar1 = 'First Name'
- nvarchar2 = 'Last Name'
- nvarchar3 = 'Phone Number'
As Sharepoints content is stored dynamically, I figure that there has to be a table which stores these mappings.
Where are the above mappings stored in the content database, and how can I query it so I can dynamically pull data from the AllUserData table for a specific list?