Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Clause OUTPUT dans SQL2000

1 réponse
Avatar
SuperGolgoth
Bonjour a tous,
j'envisage une grosse mise a jour dans une table, mais j'aimerais en
garder un trace, la clause OUTPUT me plait bien, mais je n'arrive pas a
la mettre en oeuvre

l'exemple suivant ne fonctionne pas, j'ai l'erreur suivante :
syntaxe incorrecte vers 'OUTPUT'


USE AdventureWorks;
GO
DECLARE @MyTableVar table(
EmpID int NOT NULL,
OldVacationHours int,
NewVacationHours int,
ModifiedDate datetime);
UPDATE TOP (10) HumanResources.Employee
SET VacationHours = VacationHours * 1.25
OUTPUT INSERTED.EmployeeID,
DELETED.VacationHours,
INSERTED.VacationHours,
INSERTED.ModifiedDate
INTO @MyTableVar;

Merci de votre aide

1 réponse

Avatar
Med Bouchenafa
La clause OUTPUT n'existe pas dans 2000

--
Bien Cordialement
Med Bouchenafa

"SuperGolgoth" wrote in message
news:
Bonjour a tous,
j'envisage une grosse mise a jour dans une table, mais j'aimerais en
garder un trace, la clause OUTPUT me plait bien, mais je n'arrive pas a la
mettre en oeuvre

l'exemple suivant ne fonctionne pas, j'ai l'erreur suivante :
syntaxe incorrecte vers 'OUTPUT'


USE AdventureWorks;
GO
DECLARE @MyTableVar table(
EmpID int NOT NULL,
OldVacationHours int,
NewVacationHours int,
ModifiedDate datetime);
UPDATE TOP (10) HumanResources.Employee
SET VacationHours = VacationHours * 1.25
OUTPUT INSERTED.EmployeeID,
DELETED.VacationHours,
INSERTED.VacationHours,
INSERTED.ModifiedDate
INTO @MyTableVar;

Merci de votre aide