Advertise with Googlier.com Comments for the davos collective https://davoscollective.com Stakeholder Prosperity, Shared Value and Business Longievity through Analytics Thu, 17 Mar 2016 02:27:43 +0000 hourly 1 https://wordpress.org/?v=7.0.7 Comment on Querying Active Directory (LDAP) from SQL Server by davos https://davoscollective.com/'/2013/03/04/querying-active-directory-ldap-from-sql-server/'#comment-23477 Thu, 17 Mar 2016 02:27:43 +0000 http://davoscollective.com/?p=182#comment-23477 In reply to Claudio.

Hi Claudio,
sorry for the late reply.

I think that OPENQUERY is trying to determine the datatypes being returned from LDAP and getting it wrong for the departmentNumber field. Instead of doing a SELECT TOP 800 *, select the fields individually and cast the departmentNumber field to a TEXT datatype, or perhaps a SQL_Variant to accomodate potentially different datatypes in the same column.
There are some gotchas with LDAP queries, see this

‘Select *’ in a query against AD does not return all fields as you might expect that it would. Instead, it returns the ADsPath of the object. There is no way to return all fields. – See more at: http://www.skylinetechnologies.com/Insights/Skyline-Blog/May-2013/Querying-Active-Directory-through-SQL-Server-Using#sthash.0N5MhUHC.dpuf

]]>
Comment on Querying Active Directory (LDAP) from SQL Server by Claudio https://davoscollective.com/'/2013/03/04/querying-active-directory-ldap-from-sql-server/'#comment-22199 Wed, 25 Nov 2015 10:37:17 +0000 http://davoscollective.com/?p=182#comment-22199 Hi there,
can yours help me with Querying Active Directory (LDAP) from SQL Server. I need to retrieve these attributes:

sAMAccountName
givenName
sn
departmentNumber

My query is:

SELECT top 800 * FROM OPENQUERY(ADSI, ‘SELECT departmentNumber,sn, givenName, displayName, sAMAccountName
FROM ”LDAP://ABCDCOP01.XXX.int/DC=XXX,DC=int”
WHERE objectClass = ”User” and objectCategory = ”person”
‘)

when I run, I get a message:

Msg 7341, Level 16, State 2, Line 1
Cannot get the current row value of column “[ADsDSOObject].departmentNumber” from OLE DB provider “ADsDSOObject” for linked server “ADSI”. Could not convert the data value due to reasons other than sign mismatch or overflow.

Note: I know that this message is because the attribute departmentNumber. How can I solve this? because if I remove these attribute I get the result.

]]>
Comment on Multivalue parameters in SSRS by John Doe https://davoscollective.com/'/2013/01/17/multivalue-parameters-in-ssrs/'#comment-21851 Wed, 21 Oct 2015 16:06:34 +0000 http://davoscollective.com/?p=140#comment-21851 In reply to Silver A.

Here what I did in ssrs using odbc connected to postgresql: select {col} from {table} where ltrim(to_char({col}, ‘999999’))=any (string_to_array(?,’,’)) and in the dataset parameter function: =join(Parameters!ReportParameter.Value,”,”)

]]>
Comment on SSRS dynamic hyperlink by Ajibola Raf https://davoscollective.com/'/2012/06/28/ssrs-dynamic-hyperlink/'#comment-20978 Tue, 07 Jul 2015 13:17:03 +0000 http://davoscollective.com/?p=88#comment-20978 Nice post, It really helped. Thanks!!!

]]>
Comment on Querying Active Directory (LDAP) from SQL Server by Devendra https://davoscollective.com/'/2013/03/04/querying-active-directory-ldap-from-sql-server/'#comment-20782 Wed, 17 Jun 2015 14:16:35 +0000 http://davoscollective.com/?p=182#comment-20782 Hi there,

When we run thi directly on server, it works well. But same when excuted via client throws following error message. Any thoughts?

Msg 7321, Level 16, State 2, Line 2
An error occurred while preparing the query “SELECT givenName,sn,employeeid,sAMAccountName,mail,type,whenChanged
FROM ‘LDAP://*****/DC=*******,DC=***,DC=**’
WHERE objectClass = ‘User’ AND objectCategory = ‘Person’ AND (
SN = ‘A*’
)
” for execution against OLE DB provider “ADsDSOObject” for linked server “ADSI”.

]]>
Comment on Multivalue parameters in SSRS by davos https://davoscollective.com/'/2013/01/17/multivalue-parameters-in-ssrs/'#comment-20200 Wed, 22 Apr 2015 02:25:19 +0000 http://davoscollective.com/?p=140#comment-20200 In reply to Google.

Normally I would mark this as spam, but it is just so beautiful it almost makes me want to cry

]]>
Comment on Multivalue parameters in SSRS by davos https://davoscollective.com/'/2013/01/17/multivalue-parameters-in-ssrs/'#comment-20199 Wed, 22 Apr 2015 02:19:42 +0000 http://davoscollective.com/?p=140#comment-20199 In reply to Silver A.

Hi Silver A, are your columns numeric? If so then try the version without the apostrophes.

Can you verify the values that are being generated in the ParamList? If you can then try and verify the query works with the ParamList values. i.e. try and run the query directly on Oracle. e.g. if you can verify your ParamList is returning the values 1, 2, 3, 4 then try running this on Oracle using the SQL Developer or whatever tool you use.
Select ORDER_NUM from ORD_ORDER where ORDER_NUM in (1,2,3,4);

]]>
Comment on Multivalue parameters in SSRS by Silver A https://davoscollective.com/'/2013/01/17/multivalue-parameters-in-ssrs/'#comment-20159 Sun, 19 Apr 2015 03:43:00 +0000 http://davoscollective.com/?p=140#comment-20159 I tried this solution connecting to Oracle but nothing comes up, the report comes back empty, here is what I used: =”Select ORDER_NUM from ORD_ORDER where ORDER_NUM in (‘” + Join(Parameters!ParamList.Value,”‘,'”) + “‘)”

I am missing something?

]]>
Comment on Querying Active Directory (LDAP) from SQL Server by davos https://davoscollective.com/'/2013/03/04/querying-active-directory-ldap-from-sql-server/'#comment-19426 Tue, 17 Feb 2015 10:37:02 +0000 http://davoscollective.com/?p=182#comment-19426 In reply to datagod.

Yes I can confirm this works in SQL Server 2012, and in 2014. I’m not suprised by that either. You can even just type an LDAP query into an internet browser and it will work. It’s just a protocol with an address and some arguments.

LDAP querying can be generally painful and finicky. Can you get into AD via MMC or some other tool?
You might be able to use that to then see what the OU structure is in your shop’s AD.
Then try some simpler variation on this to see if you can get anything back at all:
SELECT * FROM OpenQuery(ADSI, 'SELECT cn, distinguishedName FROM ''LDAP://OU=Client Computers,OU=Resources,DC=Domain,DC=com,DC=au'' ')

You might even be able to browse the linked server’s structure using SSMS. In the object explorer, under server objects, expand the tree for the Linked Server.

]]>
Comment on SSRS dynamic hyperlink by sravanthi https://davoscollective.com/'/2012/06/28/ssrs-dynamic-hyperlink/'#comment-19317 Thu, 05 Feb 2015 16:23:00 +0000 http://davoscollective.com/?p=88#comment-19317 =SWITCH(Fields!InvoiceDescription.Value=”Single Phase Meters”,iif((Fields!TotalUnits.Value)0,”javascript:void(window.open(‘” +Parameters!ProjectELink.Value”‘,’_blank’))”,””),
Fields!InvoiceDescription.Value=”Poly Phase Meters”,iif((Fields!TotalUnits.Value)0,”javascript:void(window.open(‘http://xxx.com/Reporting/InstalledSitesReport.aspx?service=w’,’_blank’))”,””))

i tried like this but always returning blank page

]]>