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 2005 Forums
 Transact-SQL (2005)
 how to create log tables

Author  Topic 

senpark15
Starting Member

4 Posts

Posted - 2008-05-09 : 09:39:57

hi everybody

Can anyone tell me how to crate log tables and how to insert value into log tables?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-09 : 09:45:34
Log tables are created like other tables using CREATE TABLE syntax. The values are inserted using INSERT INTO Table statement. What are you trying to log to table?
Go to Top of Page

senpark15
Starting Member

4 Posts

Posted - 2008-05-09 : 10:20:32
thanks for reply

I am creating application in C#. I want to check specific table is updated or not

if updated i want to retrieve Updated values



Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-09 : 10:26:20
quote:
Originally posted by senpark15

thanks for reply

I am creating application in C#. I want to check specific table is updated or not

if updated i want to retrieve Updated values






Ok this can be done by means of an update trigger. Create an update trigger on your main table which causes values to be inserted into log table using INSERT INTO... statement. Once this is created, any further update actions on your table automatically fires trigger and causes values to be inserted to your log table. Before you write trigger, read about update trigger in books online.
Go to Top of Page
   

- Advertisement -