Subqueries in insert statements in SQL Server 2005 and 2008

If you are writing T-SQL code targeting SQL Server 2008 you might have written statements¬†that resembles this: INSERT INTO Employee(Name, OrganisationId) VALUES(‘MyName’, (SELECT TOP 1 ID FROM Organisation WHERE Name = ‘MyOrganisation’ )) Now lets say that our T-SQL also has to run on SQL Server 2005. Nothing special here that should stop us from […]