I want know how to release IF with update and how to exec procedure with nvarchar input. There are table Dictionary with 2 values ('Orig','Translated') I need procedure that adds or replace "Trasnslated' depending on input. There must be 2 inputs, no more and no less. For example
CREATE PROCEDURE Translate_Orig (@Orig nvarchar(32),@Translated nvarchar(32))
AS
BEGIN
UPDATE Dictionary
IF EXISTS (SELECT * FROM Dictionary WHERE Dictionary.Orig=@Orig)
SET Dictionary.Translated=@Translated
ELSE INSERT INTO Dictionary VALUES (@Orig, @Translated);
END
GO
SET @Orig = N'Orig'
SET @Translated = N'traslated'
EXEC Translate_Orig (@Orig,@Translated);