MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
ALTER PROCEDURE [dbo].[SP_Update_Exchanges] @fordate datetime AS BEGIN BEGIN TRAN TRAN_SP_Ex Declare @currencyid int Declare @currency nvarchar(50) Declare @referencerate decimal(18,6) Declare @buy decimal(18,6) Declare @sell decimal(18,6) SET NOCOUNT ON; select * from exchanges where systemdate = @fordate if @@rowcount <> 1 begin SELECT @currencyid=currencyid, @currency=currency, @referencerate=referencerate, @buy=buy, @sell=sell from exchanges where systemdate = datediff(day,1,@fordate) insert into exchanges (currencyid,currency,referencerate,buy,sell,systemdate) values (@currencyid,@currency,@referencerate,@buy,@sell,@fordate) end IF @@ERROR <> 0 ROLLBACK TRAN TRAN_SP_Ex ELSE COMMIT TRAN TRAN_SP_Ex END
|SQL Merige returns error code when updating||15||57|
|get most recent and second most recent date in SQL Server||24||107|
|How can I exclude some wording in a like statement?||39||78|
|Help with SQL - TOP 10 by date and by group||13||42|