I've got this query that seems to me like it should work, but I'm no expert. It's supposed to update an existing record or insert a new record accordingly, depending on whether or not the data from the UI matches a row in the table. It does this by looking at the StandingYear column.It inserts correctly, and the data is passed through correctly when it I try to update but it simply doesn't update the database. I can't see why in the UI's business logic or in the query... anyone see anything in the query?CREATE PROCEDURE up_TeamStandingsUpdate @TeamID as int,@ConfID as int,@DivID as int,@StandingYear as int,@ConfWins as int,@ConfLosses as int,@ConfPercentage as float,@OverallWins as int,@OverallLosses as int,@OverallPercentage as float,@Rating as float,@UserID as bigintAS If Exists ( Select StandingYear From TeamStandings Where StandingYear = @StandingYear ) Update TeamStandings Set StandingYear = @StandingYear, ConfWins = @ConfWins, ConfLosses = @ConfLosses, ConfPercentage = @ConfPercentage, OverallWins = @OverallWins, OverallLosses = @OverallLosses, OverallPercentage = @OverallPercentage, Rating = @Rating, DateLastModified = GetDate(), UserLastModified = @UserID Where TeamID = @TeamID AND StandingYear = @StandingYear ELSE Insert Into TeamStandings (TeamID, ConfID, DivID, StandingYear, ConfWins, ConfLosses, ConfPercentage, OverallWins, OverallLosses, OverallPercentage, Rating, DateCreated, UserCreated, DateLastModified, UserLastModified) Values (@TeamID, @ConfID, @DivID, @StandingYear, @ConfWins, @ConfLosses, @ConfPercentage, @OverallWins, @OverallLosses, @OverallPercentage, @Rating, GetDate(), @UserID, GetDate(), @UserID)