Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2009
    Posts
    2

    Question Unanswered: Importing Multi-Value LDAP information into SQL

    I've been querying LDAP to pull information for our servers but have found certain fields (particularly the description attribute) in LDAP are Multi-Value fields and cannot be queried, at least without some additional code.

    I figured this would have been a more common issue but have been unable to find anything specifically in my searches thus far.

    Is there some kind of function or stored procedure in SQL that I need to use to convert the Multi-Value data to string data maybe?

    FYI - I'm not a complete novice with SQL but i'm not a full tilt programmer either. I'd really appreciate any input.

    Thanks

  2. #2
    Join Date
    Mar 2009
    Posts
    349
    I do not have any experience with LDAP but it sounds like you need to parse a multi valued field with SQL Servers string functions (SUBSTRING, CHARINDEX, LEFT, RIGHT etc...). Although if you have some application code that this stuff passes through it may be quicker and more efficient there because SQL is historically a poor performer in parsing strings.

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I've never worked out how to read multi valued using the OpenRowset() type functions, however it's dead easy using C#, so you might want to go down the CLR route.
    George
    Home | Blog

  4. #4
    Join Date
    Jun 2009
    Location
    CA, USA
    Posts
    59
    No, I don't think you can fetch part of it...LDAP returns all attributes with the given name...
    You may need to do the post processing after fetching the value before inserting into table...
    MohammedU
    SQL Server MVP

  5. #5
    Join Date
    Jul 2009
    Posts
    2
    Thanks for the input everyone. The C# solution sounds nice but I know I can do it in VBscript which I have more experience with so I'll probably go with that. I was just wondering if there was some way to do this natively in SQL.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •