There is no single SQL command that will get the device IP with the DN. The IP address, because it is static, is not stored in the CallManager SQL database. So you will need a two-step process.
While you may see ip addresses in the device table of the CCM03xx database if they are named that way, that is a user-definable field so you can't expect that, and that only generally applies to H.323 gateways and such anyway.
Look at the devicelistx report for a way to retrieve device ip addresses along with their device name (and other attributes, but not DN):
SIP traces provide key information in troubleshooting SIP Trunks, SIP
endpoints and other SIP related issues. Even though these traces are in
clear text, these texts can be gibberish unless you understand fully
what they mean. This document attempts to br...
Please find the attached HTML document, download and open it on your PC.
This provides an easy to use form where you simply answer a few
questions and it will render the proper jabber-config.xml file for you
to copy/paste. There is built in logic to verif...
CUCM Database Replication is an area in which Cisco customers and
partners have asked for more in-depth training in being able to properly
assess a replication problem and potentially resolve an issue without
involving TAC. This document discusses the bas...