#147793 - 2005-09-14 07:29 PM
Inserting software inventory in SQL database (or access)
|
shtroumf
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
|
|
|
|
#147797 - 2005-09-19 10:23 AM
Re: Inserting software inventory in SQL database (or access)
|
Richard H.
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
   
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 989 anonymous users online.
|
|
|