cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
240
Views
0
Helpful
1
Replies

Corporate Directory - SQL

gthjohansson
Level 4
Level 4

Hi

Does anyone know where I could get my hands on the old SDK SQL Corporate Directory example script ?

Or is there anyone using another SQL Corporate Directory ?

kind regards

Gudmundur Thor Johannsson

1 Reply 1

RowanMark
Level 1
Level 1

Is this something you were looking for?

2 seperate scripts

select num.DNOrPattern Ext, dev.description Owner, right(dev.name, 12) MAC, typ.name Model, loc.name Location

from dbo.device dev

inner join dbo.devicenumplanmap dvn

on dev.pkid = dvn.fkDevice

inner join dbo.Location loc

on loc.pkid = dev.fkLocation

inner join dbo.typemodel typ

on dev.tkmodel = typ.enum

inner join dbo.numplan num

on dvn.fknumplan = num.pkid

where PATINDEX('%SEP%',dev.name)=1

order by Ext

select right(dev.name, 12) MAC, count(dev.description) as Lines_on_mac_address

from dbo.device dev

inner join dbo.devicenumplanmap dvn

on dev.pkid = dvn.fkDevice

inner join dbo.typemodel typ

on dev.tkmodel = typ.enum

inner join dbo.numplan num

on dvn.fknumplan = num.pkid

where PATINDEX('%SEP%',dev.name)=1

group by dev.name