EDIT : To prevent race conditions in a parallel environment, use WITH (UPDLOCK) in the correlated subquery.
I think this will be the standard method:
INSERT INTO MarketPrices (SecurityCode, BuyPrice, SellPrice, IsMarketOpen) SELECT @SecurityCode, @BuyPrice, @SellPrice, @IsMarketOpen WHERE NOT EXISTS ( SELECT * FROM MarketPrices WITH (UPDLOCK) WHERE SecurityCode = @SecurityCode AND BuyPrice = @BuyPrice AND SellPrice = @SellPrice )
If any of your fields is NULL, you should add this condition.
Your first method is interesting, but the EXCEPT requirements you jump through hoops. This method is essentially the same, but it causes a column problem.
As an alternative:
INSERT INTO MarketPrices (SecurityCode, BuyPrice, SellPrice, IsMarketOpen) SELECT SecurityCode, BuyPrice, SellPrice, @IsMarketOpen FROM ( SELECT @SecurityCode, @BuyPrice, @SellPrice EXCEPT SELECT SecurityCode, BuyPrice, SellPrice FROM MarketPrices WITH (UPDLOCK) ) a (SecurityCode, BuyPrice, SellPrice)
In this case, the good thing about EXCEPT is that it processes NULL without any additional coding on your part. To achieve the same as in the first example, you will need to test each pair for NULL, and also for equality, for a long time.
Your second method is fine, but you don't need a variable. See Tomalak Solution, he cleaned it well. In addition, you will need to explicitly handle the possibility of simultaneous inserts if this was a problem.