Kalle,It is dutch, But you'll get the drift.This is a hard coded part of my stored procedure (there're 50 actions like this with 50 different INSERT INTO's).-- Actie 1 InmetenINSERT INTO Workflow.dbo.tblTaak (Invoerder, ReferentieProces, Actie, Titel, Inhoud, Prioriteit, Rol, DagenOpen, Doorlooptijd)SELECT 'SYS', rp.[Id], 1 -- Actie 1 --> Inmeten versturen, actie.Naam -- Titel van de actie, actie.Inhoud -- Inhoud,30 -- Prioriteit normaal, actie.Rol -- Rol montage afdeling--, DateDiff (d, po.InvoerDatum, GetDate()) -- Aantal dagen open,(SELECT COUNT(*) FROM Oresys.dbo.tblDatumPeriode WHERE Datum BETWEEN po.InvoerDatum AND GetDate() AND Werkdag = 1) -- Werkdagen open, actie.Doorlooptijd -- DoorlooptijdFROM Workflow.dbo.tblProcesOrder poJOIN Workflow.dbo.tblReferentieProces rp ON po.ReferentieProces = rp.[Id]JOIN Workflow.dbo.tblReferentie r ON r.[Id] = rp.ReferentieJOIN KIMS.dbo.Kimslnk k ON k.Refnr = r.ReferentieNummerJOIN Oresys.dbo.tblVestiging v ON v.VestigingCode = k.Vest AND v.Actief = 1JOIN Oresys.dbo.tblAttribuut a ON r.ReferentieNummer = a.ReferentieNummerJOIN Workflow.dbo.tblActie actie ON Actie.[Id] = 1 AND Actie.Actief = 1 -- LET OP, ook hier actie goed invullen !!WHERE VerstuurdInmeten IS NULL -- Er is nog niet ingemetenAND NietInmeten IS NULL -- Er is ook niet gezegd dat er niet ingemeten hoeft te worden
I want to store these insert as TEXT fields in the tblAction.and execute it in a stored procedure likeDECLARE @InsertQuery AS VARCHAR (2000)SELECT @InsertQuery = ActionText FROM tblAction WHERE ActionId = 3EXEC (@InsertQuery) The proces table has some 50.000 records (so every tblAction query is over this 50.000 records).But is there a huge performance penalty?Henri~~~Success is the ability to go from one failure to another with no loss of enthusiasm