Hello
I've got such openquery
SELECT * FROM Openquery(ADSI, 'SELECT EmployeeID, displayname, mailAddress,
country FROM ' LDAP://MY-LDAP-PATH '
WHERE country='coutry_code' ' ')
country_code is 3 letters i think sth in format like USA, FRA etc
I will need to retrieve users from up to 3 countries let say and i would like to create from this query above a stored procedure (or better a FUNCTION) where someone calling a function can specify from which country does he/she wants to terieve users
- when none country specified a function should retrieve users from all 3 let say.
I'm not very advanced in programming in T-SQL yet so my question is -> can the variable be specified inside Openquery ?
like for example
SELECT * FROM Openquery(ADSI, 'SELECT EmployeeID, displayname, mailAddress,
country FROM ' LDAP://MY-LDAP-PATH '
WHERE country='@country' ' ')
ACTIVE DIRECTORY HAS LIMITION OF RETRIEVING 1000 RECORDS AT ONCE - BUT NONE OF THESE COUNTRIES HAVE MORE THAN COUPLE HUNDREDS HOVWEVER summing them in one query this number of course
will exceed 1000 recoreds so queries i think should be splitted and joined with union ???
Can anyone provide some example code of such function
The other problem i have is that openquery againt ADSI above works correctly when i use SSMS localy on the server (connectin
View Complete Post