NBS Posted March 25, 2009 Report Share Posted March 25, 2009 Sveiki, izstāstīšu ko gribu panākt, jo domāju, ka mans kods ir caur vienu vietu. Vēlos palaist triggeri, lai tas selektē kodu pēc tam pie UPDATE šo pašu kodu pieskaita kontrolsummai, kas tiek veikta caur funkciju "_sp_fao_code_cksm". Lūdzu, izpalīdziet. CREATE TRIGGER insert_code ON dbo.customers AFTER INSERT AS DECLARE @customerid int IF UPDATE (code) BEGIN SELECT @customerid=customID FROM inserted UPDATE customers SET code = (@customerid + _sp_fao_code_cksm(@customerid)) WHERE customerid = @customerid END Quote Link to comment Share on other sites More sharing options...
Delfins Posted March 26, 2009 Report Share Posted March 26, 2009 īsti nesaprotu, kāda jēga no kolonnas `code`? Quote Link to comment Share on other sites More sharing options...
NBS Posted March 27, 2009 Author Report Share Posted March 27, 2009 Beigās sanāca, ka to, ko es gribēju bija neiespējams iegūt :( Jo nevar izpildīt triggers INSERT UPDATE un tad atkal INSERT UPDATE, nav tādas iespējas. Triggerī ir tikai paredzēts uzreiz INSERTS un tad tikai UPDATE vai otrādi, nevar katru mainīgo atsevišķi mest. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.