Creating and Executing a View
You can create a view for data obtained from Active Directory. Be aware that only the view definition is stored in SQL Server, and not the actual result set. Therefore, you may get a different result when you invoke the view at a later time.
The following code sample shows how to create a view.
CREATE VIEW viewADUsers
AS
SELECT * FROM OpenQuery( ADSI,
'<LDAP://DC=Fabrikam,DC=com>;(&(objectCategory=Person)(objectClass=user));name, adspath, title;subtree')
Use the following code to invoke a view.
SELECT * from viewADUsers
Related topics
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for