Page 1 of 1 1
Topic Options
#147793 - 2005-09-14 07:29 PM Inserting software inventory in SQL database (or access)
shtroumf Offline
Fresh Scripter

Registered: 2005-08-13
Posts: 7
I have already made my script inserting my computers informations in a SQL database named inventory with a table named Computers.
I insert the wksta name, ip, mac, mem, disk size... etc etc etc..
This is simple to implement because I Have One value for each column.. ie : Computer name = stbo, installedMem=1024, CPU speed= 1700 etc etc etc...
Where I'm stuck is How can I insert the Software list of One computer into one of these colomn... For now, I export the software list to a text file, but its not a clean way of doing it..
I would like to have something like a table named software, and into that table having a colomn that can take Array of data or something like that, so i could have like..
Copmuter = stbo, Software= acrobat reader,microsoft office,McAfee, etc etc etc... and after, the table juste continu normally with InstalledRAM=1024, Harddrive=10000, Windows=Winxpsp2, etc etc etc..

I hope you understand what i say.. Im a french guy you know

I tough about doing comething like this for the list of software.
I could make a table named SOFTWARES
Into it I would have a colomn named Wksta and one named Soft
And it could insert data like this

Wksta , Soft
stbo , microsoft office
stbo , microsoft antispyware
stbo , mcafee
stbo , acrobat
ands , microsoft office
ands , microsoft antispyware
ands , mcafee
etc etc etc ...

I find this way of doing it a little bit Over loaded in informations... isnt it???

Top
#147794 - 2005-09-18 07:31 PM Re: Inserting software inventory in SQL database (or access)
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
By using a proper relational model of your data. E.g. one table containing the list of computers, a second table containing a list of software, and a thrid, cross-reference table linking computer and software together for the inventory. nortmalize as necessary
Code:

COMPUTER_BASE
1=AAA
2=BBB

SOFTWARE_BASE
1=Software A
2=Software B

COMPUTER_SOFTWARE_XREF
1=1
1=2
1=2


Which means that computer AAA has software A&B whereas computer BBB has only software B.
_________________________
There are two types of vessels, submarines and targets.

Top
#147795 - 2005-09-19 01:14 AM Re: Inserting software inventory in SQL database (or access)
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
really? can't get the logic of the last one...
_________________________
!

download KiXnet

Top
#147796 - 2005-09-19 02:21 AM Re: Inserting software inventory in SQL database (or access)
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
XREF table: first column has the primary key of the COMPUTER_BASE table, second colum has primary key of the SOFTWARE_BASE table. Thus, it's a one-to-many relationship, one computer can have many software.
_________________________
There are two types of vessels, submarines and targets.

Top
#147797 - 2005-09-19 10:23 AM Re: Inserting software inventory in SQL database (or access)
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Quote:

I find this way of doing it a little bit Over loaded in informations... isnt it???




Yes and no

There is a technique in analysing data called "normalising". The technique is ultimately used to reduce duplicated data to a single instance without losing any of the implied information like relationships.

Normalising the data will help to ensure that there is less likelihood of errors occurring, that problem solving is much more simple and that changes to data (maintenance) is easier. You will also reduce the amount of memory required to manage the tables and the amount of disk required to store the data.

However, normalising also introduces overheads. You may need more tables, you may need more CPU cycles to reconstruct the data. The additinal indexes make the database more complex and requires more effort to maintain and repair when there is an error. You are more likely to need database transaction support to ensure data integrity.

The trick is therefore to know when to stop normalising.

In your case it depends how much data you are going to generate and what you are going to do with it.

I think that storing the PC name and application name in the table as you have suggested is absolutely fine. I'd only look at his again if you have more than 10,000 computers to index or you calculate that you will have trouble with disk space.

Top
#147798 - 2005-09-19 10:25 AM Re: Inserting software inventory in SQL database (or access)
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Quote:

hmm...
really? can't get the logic of the last one...




Agreed, there is an error in the table. See my last post on normalising "adding complexity"

The table should look like this:
Code:
COMPUTER_SOFTWARE_XREF
1=1
1=2
2=2


Top
#147799 - 2005-09-20 03:29 AM Re: Inserting software inventory in SQL database (or access)
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Yeah, sorry, typo
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 809 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.062 seconds in which 0.029 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org