Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE
CREATE FUNCTION [dbo].[fnCorresMetaData] (@CorroID char(48), @XMLPayload xml, @UpdCount smallint) RETURNS TABLE AS BEGIN --Need to lock row to prevent double read/insert SET TRANSACTION ISOLATION LEVEL SERIALIZABLE -- Check If Row exists SELECT CorroID,XMLPayload,UpdCount FROM CorresMetaData WHERE CorroID = @CorroID IF @@ROWCOUNT = 0 -- If no row exists create one BEGIN INSERT INTO CorresMetaData (CorroID , XMLPayload ,UpdCount) VALUES (@CorroID ,@XMLPayload ,1) END ELSE -- If row exists append input xml into existing xml and increment UpdCount BEGIN UPDATE CorresMetaData SET XMLPayload = XMLPayload&@XMLPayload,UpdCount = UpdCount+1 WHERE CorroID = @CorroID END COMMIT -- Commit Update or Insert then retrieve. RETURN SELECT CorroID,XMLPayload,UpdCount FROM CorresMetaData WHERE CorroID = @CorroID END