cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
581
Views
5
Helpful
2
Replies

CUCM SQL request

Hi,

1 can anyone share SQL query to request list of the users device profiles UDP with associated numbers/Lines please ?  For example an user device profile em.bose may have 2 line , em.jannet may have 3 lines, so how to query SQL to show all em profiles showing those lines ? 

 

 

 

Thank you .

2 Replies 2

Aeby Vinod
Level 3
Level 3
Try this query, should give the list of all teh UDP's with DN's associated to them, and if multiple DN's are associated then it should give you multiple entries.

run sql select eu.userid, d.name, d.description, n.dnorpattern as DN from device as d inner join devicenumplanmap as dnpm on dnpm.fkdevice = d.pkid inner join enduserdevicemap as eudm on eudm.fkdevice=d.pkid inner join enduser as eu on eudm.fkenduser=eu.pkid inner join numplan as n on dnpm.fknumplan = n.pkid and d.tkclass = 254

Please rate if you find this helpful.

Regards,
Aeby


Please rate if you find this helpful.

Regards,
Aeby

Thanks for the query Aeby. I was only getting the second line if multiple lines were returned from the UDP. Adding the numplanindex seems to correct if you're only looking for the primary line. Thanks again, Derek

run sql select eu.userid, d.name, d.description, n.dnorpattern as DN from device as d inner join devicenumplanmap as dnpm on dnpm.fkdevice = d.pkid inner join enduserdevicemap as eudm on eudm.fkdevice=d.pkid inner join enduser as eu on eudm.fkenduser=eu.pkid inner join numplan as n on dnpm.fknumplan = n.pkid and d.tkclass = 254 and numplanindex = 1