|
Posted by Erland Sommarskog on 10/02/52 11:49
Jchick (jchickering@gmail.com) writes:
> I'm on to new problems. Trying to learn how to set up the trigger to
> send to an Access database's table. I was playing with this idea some
> time ago and I believe you got me on the path to Linked Servers. So,
> I've got a linked server to an Access database, one table with the
> exact same 'fields'. I still want it to write only if the record is
> unique. I'm trying to use the suggestions you gave me earlier:
>
> CREATE TRIGGER [Populate AccessTable] ON [dbo].[ClientFile]
>
> AFTER INSERT AS
>
> INSERT mastertable (ProspectName)
>
> SELECT i.ProspectName
> FROM inserted i
> WHERE NOT EXISTS (SELECT * FROM mastertbl.m WHERE m.ProspectName =
> i.ProspectName)
In theory, just replace "mastertbl" with LINKEDSERVER...mastertbl. Maybe
you will have to put something between the dots, Access is not my realm.
But I would not be surprised if it fails, there is always a lots and
ifs and buts with linked server.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|