cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
305
Views
0
Helpful
2
Replies

If anyone is querying the DB using SQL

Here a few queries I wrote

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

and

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

Enjoy......

2 Replies 2

czuker0
Level 1
Level 1

Hello,

Do you known how to connect to a SQL database from .asp?

%Regards

Darek

mark1mccorkle
Level 1
Level 1

Hi,

I am brand new to Call Manager. Just got it a week ago. Can you explain to me exactly how to run these queries? I can log in to CCM server.

Thanks,

Mark