Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Make this a trigger?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01060793
Message ID:
01061328
Vues:
11
Try
CREATE TRIGGER utr_resources_Insert
ON resources
FOR INSERT 
AS 
BEGIN
	INSERT INTO Monitoring (pk_appid, ApplicationName)
		SELECT pk_resource, resdesc FROM INSERTED 
			WHERE NOT EXISTS( SELECT * FROM Monitoring 
					WHERE Monitoring.pk_appid = INSERTED.pk_resource)

END
>I need to make this into a SQL Server 2000 trigger....
>
>SELECT pk_appid ;
> FROM Monitoring ;
> WHERE Monitoring.pk_appid = resources.pk_resource ;
> INTO CURSOR (curMonitoring)
>
>SELECT Monitoring
>IF RECCOUNT('curMonitoring') = 0
> APPEND BLANK
>ENDIF
>
>Replace Monitoring.pk_appid WITH resources.pk_resource ,;
> Monitoring.ApplicationName WITH resources.resdesc
>
>
>....the trigger obviously would to in the 'resources' table...anyone know what the trigger syntax should be?
>
>Thanks!
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform