You are here: Re: Trigger to populate table or database « MsSQL Server « IT news, forums, messages
Re: Trigger to populate table or database

Posted by Jchick on 10/02/77 11:49

I figured it out, I got the error trying to make a new trigger, but I
already had an existing trigger name in the selection box. It was a
bonehead mistake.

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)

Thanks again for your assistance!

Jchick




there but cannot remember the syntax to put in the trigger to go to a
linked
Erland Sommarskog wrote:
> Jchick (jchickering@gmail.com) writes:
> > Incidentally, I tried the code below and cannot seem to make it work
> > for populating the "mastertable". The Syntax is ok but something is
> > wrong with as I am getting "Error 31037, the name specified in the
> > Text property's 'CREATE...etc"
>
> Where do you get this error? What is the complete error message?
> There is no error number 31037 in SQL Server, so I suspect that this
> is an message your environment.
>
>
> --
> 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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация