Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jewel
Starting Member
18 Posts |
Posted - 2004-08-17 : 21:07:17
|
| If I have a table like this: table is called Call_SubjectCallSubjectUnique 3481CallSubjectType 3CallSubject1 Building ServicesCallSubject2 HelpCallSubject3 CopierMinCharge 0ChargeRate 0MaterialCharge 0TTHrs <NULL>TTMins <NULL>DefaultPriority <NULL>ScriptComments InfoCommentsSLTUnique1 21SLTUnique2 <NULL>SupportGroupUnique 66IthelpUserUnique <NULL>Timestamp <Binary>other tables access this information as a lookup table - eg main table that accesses is a call_tableThis is a huge database, so is there anything you can tell me about how to find out if the subject has been accessed or used.I tried using the Timestamp field eg <>1 or 0 but didn't seem to give the correct results.I know this is a longshot without knowing the setup but worth a trythanksjewel |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2004-08-17 : 21:27:41
|
| What do you mean used?You can't get information on when a particular record was last accessed |
 |
|
|
jewel
Starting Member
18 Posts |
Posted - 2004-08-17 : 21:49:21
|
| thanks Tim - ok maybe I need to explain a little morewe have over 3500 service/category/items = field 1/2/3I was asked to find out how many of these have never been used.so we log a call - it then uses the call_subject table as a lookup for these three fields and logs the call. (which is why I thought the binary field might have been a good choice)so other than exporting 3500 entries to excel and then trying an export of all the ones with a call against it - I didn't know who else to approach itthanks |
 |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2004-08-18 : 02:01:53
|
So, if it uses the table as a lookup then presumably the ID of the call_subject in the call_table table?If so, all you need to do is run a query joining these two:SELECT S.* FROM call_subject S LEFT JOIN call_table T ON S.CallSubjectID = T.CallSubjectIDWHERE T.CallSubjectID IS NULL This will list all call_subject records that are not referenced by the call_table table. |
 |
|
|
|
|
|