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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 How to do this???

Author  Topic 

Arijit
Starting Member

25 Posts

Posted - 2006-01-02 : 07:14:46
Hi,
I have a table called session.Anytime it consists only single row. Because no insertion is taken in this table only the updation on exeisting row. But my problem is I want to see the all previous record.I thought few solutions like creating Trigger.But client don't want to go for that.I also went to read the logs.I used DBCC LOG command. But there also it is not telling anything specifically with the insert and prev insert.Now I am out of thoughts.Can anyone put some new ideas on this matter.
Thanks in advance..
Regards
Arijit

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-01-02 : 07:25:36
If you need to have a audit trail on the session table, trigger with an additional audit trail table is the best solution. You can access all changes (who, when, what) to that session table from the audit trail table in your app.

-----------------
[KH]

Learn something new everyday
Go to Top of Page

Arijit
Starting Member

25 Posts

Posted - 2006-01-02 : 07:37:03
Hi [KH],
Thanks for your answer.But whatever I got from your answer is I need to create another table and a trigger.The trigger will insert the value to the second table.If my understanding is right then one more thing I need to tell you ,the client is not happy with this solution.That is why I am really in anxiety..:(
Thanks again for your reply..
Regards
Arijit
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-01-02 : 09:22:54
quote:
Originally posted by Arijit

.... ,the client is not happy with this solution......



If they r worried about the Trigger:
U should tackle that in the presentation or business layer, so that whenever u do ur update, another SQL statement should write to (Insert Into) another table the contents before updating the original
along with the user, date/time etc.

If they r worried about writing to another table, then
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-02 : 10:02:44
What is the difficulty in using Triggers?
Have a trigger that insert the old data to other table whenever the table is updated
Otherwise if dont want to create another table, append the data to some text files before running update query

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-01-02 : 12:40:05
"But client don't want to go for that"

Short of you giving me some additional information as to why the client thinks that this is a bad idea then the client is wrong.

Trigger is the best way to go. Yes you could do it elsewhere, but it isn't going to trap every update that could be made; we have stacks of tables that have triggers on that just copy the "old" data to an audit table, works a treat.

Kristen
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2006-01-02 : 14:51:26
Nice design,
the business requirements state that you need to see all the records, but the database only stores the last record!

I want a blue T-Ford, but I can't repaint it.

rockmoose
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-03 : 00:23:36
>>I want a blue T-Ford, but I can't repaint it.

Also you are not allowed to buy new one

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2006-01-03 : 03:47:43
quote:
Originally posted by madhivanan

>>I want a blue T-Ford, but I can't repaint it.

Also you are not allowed to buy new one

Madhivanan

Failing to plan is Planning to fail



They only came in black, even as new!
Go to Top of Page

Arijit
Starting Member

25 Posts

Posted - 2006-01-03 : 04:16:02
Hi ALl,
Thanks a lot..For your great support..
Regards
Arijit Chatterjee
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-03 : 04:25:39
quote:
Originally posted by Arijit

Hi ALl,
Thanks a lot..For your great support..
Regards
Arijit Chatterjee


What have you decided to do?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-01-03 : 08:05:07
"I want a blue T-Ford, but I can't repaint it"

Course you can. You just won't know what the old colour was

In fact ... the old colour will be a rather good definition of ... errmmm ... "NULL" !!

Kristen
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2006-01-03 : 15:18:13
In fact ... the old colour will be a rather good definition of ... errmmm ... "NULL" !!

Not if I implement change-tracking triggers on the vehicles colour,
and btw I would never allow the colour NULL on a T-Ford

rockmoose
Go to Top of Page

Arijit
Starting Member

25 Posts

Posted - 2006-01-04 : 00:21:18
Hi All,
I have not decided anything. I have discussed the matter with client. I think they will go for third party tool for reading log.That is the status now..
Regards
Arijit Chatterjee
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-04 : 00:32:13
What is the difficulty in having a History table that has all Updates?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-01-04 : 00:47:28
>> What is the difficulty in having a History table that has all Updates?
maybe he charge his client by number of tables or number of triggers ? Additional table additional $$$

-----------------
[KH]

2006 a new beginning
Go to Top of Page

Arijit
Starting Member

25 Posts

Posted - 2006-01-04 : 01:48:16
Yes Clent doesn't want to implement ant Trigger or Table in his production database.
And that is the main probs.But from my end nothing to do more.I have only told about the
third party tool.. That is the update now..
Thanks
Arijit
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-01-04 : 07:56:18
Good luck with interpreting the logs with a log-reader-tool - relative to giving the users some application tools that allow them to see the data history for themselves!

But I'm sympathetic to the testing effort that is required for ANY change to an existing, running, working system.

Kristen
Go to Top of Page
   

- Advertisement -