Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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