Using getdate() on updates

Using getdate() on updates

Post by Esteban Caldentey Morale » Sat, 06 Feb 1999 04:00:00



Hi everyone, i have the following problem:
i need to store the date and time of the creation and modifications of
the records on a table, to do that, the table has 2 DateTime fields,
Creation and Modification, each field has the getdate() function as
default. When a new records is inserted the date and time are stored
okey, but when a modification is perfomed i have to pass the date and
time of the client computer as the modification date and time. I know is
an awful way to control the modifications, so i want that the server
does the date and time update. How i can do that?Triggers or
Storeprocedure? and How (please an example if is posible)?

If anubody can help me i will appreciate it, thank in advance Esteban

 
 
 

Using getdate() on updates

Post by Esteban Caldentey Morale » Sat, 06 Feb 1999 04:00:00


Hi everyone, i have the following problem:
i need to store the date and time of the creation and modifications of
the records on a table, to do that, the table has 2 DateTime fields,
Creation and Modification, each field has the getdate() function as
default. When a new records is inserted the date and time are stored
okey, but when a modification is perfomed i have to pass the date and
time of the client computer as the modification date and time. I know is
an awful way to control the modifications, so i want that the server
does the date and time update. How i can do that?Triggers or
StoreProcedures? and How (please an example if is posible)?

If anybody can help me i will appreciate it, thank in advance Esteban.

 
 
 

Using getdate() on updates

Post by Gary Abbot » Mon, 08 Feb 1999 04:00:00


Use ad trigger that updates the datetime fields.  You should have one
for created and one for last modified.

--
Gary Abbott

http://www.pow-wow.net

 
 
 

Using getdate() on updates

Post by Esteban Caldentey Morale » Thu, 11 Feb 1999 04:00:00


Thank Gary for the information, i will do so.

Regards, Esteban.

Gary Abbott escribi:

> Use ad trigger that updates the datetime fields.  You should have one
> for created and one for last modified.

> --
> Gary Abbott

> http://www.pow-wow.net

 
 
 

1. trying to update datetime field to char (so it can be used with getdate())

Ok I converted the date so that it only shows the

7. What's the best way to implement this?
... thanks for the help!

CREATE PROCEDURE Curzs
AS

DECLARE Cur668 CURSOR
        Keyset
        FOR

        FROM baclosetable
OPEN Cur668

BEGIN
        FETCH NEXT FROM Cur668


END      
CLOSE Cur668
DEALLOCATE Cur668

2. Oracle 8.1.5 NT Valid Password Characters?

3. GETDATE() problem with smalldatetime (where mydate = getdate()?)

4. HELP with PROTECTED MODE ERROR

5. GetDate() incorrect for updating smalldatetime column

6. Multi-Media Databases

7. BUG ALERT - 6.0 sp3 - UPDATE w/ GETDATE

8. Help with SQL Query

9. Using Getdate() or Newid() in a User Defined function

10. using getdate() in an udf

11. GETDATE() can't be used in functions?? :(

12. Need help using GETDATE() function!!

13. Using GetDate() in a user defined function