You are here: Trigger Question « MsSQL Server « IT news, forums, messages
Trigger Question

Posted by Jchick on 10/02/84 11:44

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)

 

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

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