Hi Tek-Tips,
I'm a little confused. I'm new to SQL and usually design small Access database.
This time I want to create a Client/Server database with SQL Server 2000 as a backend and MS Acess Data Project as the frontend.
I created a table called MasterInstructor.
Sample of fields:
InstructorID (PrimaryKey), Name, Address, City, SSN, CertDate, NewRecordDate, UpdateRecordDate.
The field "NewRecordDate" is a date/time when the record was created.
The field "UpdateRecordDate" is a date/time of when the record was last updated.
I created a trigger (I hear they are evil):
CREATE TRIGGER [UpdateDate] ON [dbo].[MasterInstructor]
FOR UPDATE
AS
UPDATE MasterInstructor SET
UpdateRecordDate = GETDATE()
but it updated every record. I added WHERE InstructorID = @@IDENTITY and that didn't work.
What do I need to do with the WHERE clause in order to update that field whenever 1 or more records are updated from the client? I've seen some posts that mention psuedo insert table but I don't understand what that is?
I'm developing a healthy respect for anyone who is an expert at this point!
Thanks
I'm a little confused. I'm new to SQL and usually design small Access database.
This time I want to create a Client/Server database with SQL Server 2000 as a backend and MS Acess Data Project as the frontend.
I created a table called MasterInstructor.
Sample of fields:
InstructorID (PrimaryKey), Name, Address, City, SSN, CertDate, NewRecordDate, UpdateRecordDate.
The field "NewRecordDate" is a date/time when the record was created.
The field "UpdateRecordDate" is a date/time of when the record was last updated.
I created a trigger (I hear they are evil):
CREATE TRIGGER [UpdateDate] ON [dbo].[MasterInstructor]
FOR UPDATE
AS
UPDATE MasterInstructor SET
UpdateRecordDate = GETDATE()
but it updated every record. I added WHERE InstructorID = @@IDENTITY and that didn't work.
What do I need to do with the WHERE clause in order to update that field whenever 1 or more records are updated from the client? I've seen some posts that mention psuedo insert table but I don't understand what that is?
I'm developing a healthy respect for anyone who is an expert at this point!
Thanks