Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Active Directory Query and Variables may not change type during execution ERROR

$
0
0

I am querying Active Directory in an Execute SQL Task with the following query:

select sAMAccountName, displayname, title, telephonenumber, department,  mail, l
FROM 'LDAP://MyDCInfo'
where objectClass = 'user'
AND objectCategory='person'
and mail = '*@*'
and useraccountcontrol <> 514

I am looping through the results and created a Script Task to create a Message Box with one of the values. After the first loop I get the following error: 

The type of the value being assigned to variable "User::User_Location" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.
Error: 0xC001C012 at Foreach Loop Container: ForEach Variable Mapping number 1 to variable "User::User_Location" cannot be applied.

It appears there is a NULL value and this seems to be causing the issue. I've tried changing my query to use COALESCE but that does not work. How can I convert NULLs to '' for the query above? Or is there another solution to this issue?

James


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>