cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
334
Views
4
Helpful
2
Replies

sql query to pull line and device info

Live2 Bicycle
Level 3
Level 3

I have two tables dbo_device that holds the device info and table dbo_DeviceNumPlanMap that holds the line info for a device. I am trying to pull the e164mask info and associate with the device description info.

This is my query

SELECT dbo_Device.Name, dbo_Device.Description, dbo_DeviceNumPlanMap.Label, dbo_DeviceNumPlanMap.Display, dbo_DeviceNumPlanMap.E164Mask

FROM dbo_Device RIGHT JOIN dbo_DeviceNumPlanMap ON dbo_Device.ikDevice_DefaultProfile = dbo_DeviceNumPlanMap.fkDevice

WHERE (((dbo_DeviceNumPlanMap.E164Mask)='3175551212'));

The issue is I cant really find any fields between the two that coorolate. I found one field but that only match device profiles.

Is there another table I should be including to get the info I need?

2 Replies 2

pklos
Level 4
Level 4

You should also check NumPlan table (DeviceNumPlanMap.fkNumPlan = NumPlan.pkid)

E164 number you can get using deviceNumPlanMap.e164mask and numplan.dnorpattern fields

--

regards,

pk

Live2 Bicycle
Level 3
Level 3

I started playing with the SQl Database Diagram tool. I figured out when I included the Device table and the DeviceNumPlanMap table it did the diagram then I could look at the connecting line between the two tables. The properties of the connecting line showed me what fields matched. The Device - PKID field

DeviceNumPlanMap - fkDevice field

Matched

Hope this helps someone else!