When I use MSBuild 4 I can target .NET Framework 3.5 and older versions, and all features available only on the version 4 will not be available on that project.
I would like to do a similar thing in SQL Server 2012. Can I configure a database in it to behave similary to a SQL Server 2008 one? Can I make one database to not accept commands only available to SQL Server 2012?
You can set the Compatability Level within the database properties.
Properties
Options
Choose the Compatability Level
This option only affects the behaviour of this particular database, not the entire server. It should be regarded only as partial backwards compatibility. If your intention is for SQL Server to treat this database as a SQL 2008 database, then the best way to do this would be to run it within SQL 2008 rather than SQL 2012.
Here is a very detailed explanation: http://technet.microsoft.com/en-us/library/bb510680(v=sql.110).aspx
T-SQL
ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = { 90 | 100 | 110 }