Trigger Question



This outta be an easy one for someone. I have the following code in my
trigger. I am trying to connect to a DSN that is pointing to an Access
database (.mdb). However, I am not sure how to actually write the
Select From statement (see "A DSN I MADE" in the code below).

Any hints as to how I reference a DSN in the select statement?

Thanks in advance

Chick

============start of trigger===========

CREATE TRIGGER [Populate Customer Name] ON [dbo].[Invoices]

FOR INSERT, UPDATE

AS

DECLARE @InvoiceNo VARCHAR(20)
DECLARE @VendorName VARCHAR(50)

SELECT @InvoiceNo = (select InvoiceNo from inserted)
SELECT @VendorName = (select VendorName from "A DSN I MADE" where
InvoiceNo = @InvoiceNo)

Update Invoices
set VendorName = @VendorName
where F_DocumentID = (select F_DocumentID from inserted)

.



Relevant Pages

  • Re: Trigger Question
    ... I am trying to connect to a DSN that is pointing to an Access ... SELECT @InvoiceNo = ... SET VendorName = a.VendorName ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: Trigger Question
    ... Check out "linked servers" in the BOL. ... I am trying to connect to a DSN that is pointing to an Access ... DECLARE @InvoiceNo VARCHAR ... DECLARE @VendorName VARCHAR ...
    (comp.databases.ms-sqlserver)