I have a question about string manipulation in SQL Server. I have more of an Oracle background and can do this in SQL*Plus, but I'm having trouble coming up with a working SQL Server version.
The situation is, I have an application that sits on MS SQL Server. It uses LDAP to authenticate users. The users' LDAP info (distinguishedName) is kept in the database. We recently had a change to our LDAP systems that means we need to change the information in the database to match the new format. We have many thousands of users, so it's too big to be done manually.
What I need is an update command that will change the distinguishedName that is stored as follows...
From: [tt]uid=myuserid,ou=M,ou=xyz,ou=accounts,DC=COMPANYNAME,DC=COM[/tt]
To: [tt]CN=myuserid,OU=MYDOMAIN,OU=Accounts,DC=CompanyName,DC=com[/tt]
That is, I just need to cut out the 'myuserid' and build the new distinguishedName from that. Any help would be appreciated.
I'm still working on it (learning exercise). If I come up with something that looks right to me, I'll post it for critique and comments.
The situation is, I have an application that sits on MS SQL Server. It uses LDAP to authenticate users. The users' LDAP info (distinguishedName) is kept in the database. We recently had a change to our LDAP systems that means we need to change the information in the database to match the new format. We have many thousands of users, so it's too big to be done manually.
What I need is an update command that will change the distinguishedName that is stored as follows...
From: [tt]uid=myuserid,ou=M,ou=xyz,ou=accounts,DC=COMPANYNAME,DC=COM[/tt]
To: [tt]CN=myuserid,OU=MYDOMAIN,OU=Accounts,DC=CompanyName,DC=com[/tt]
That is, I just need to cut out the 'myuserid' and build the new distinguishedName from that. Any help would be appreciated.
I'm still working on it (learning exercise). If I come up with something that looks right to me, I'll post it for critique and comments.