• I got it right but I had to think about this one.

    I thought the error was going to be caused by not having a space between the two commands.

    Set @strSql = @strSql + 'Create table #tmp (id int)'

    Set @strSql = @strSql + 'Insert into #tmp(id) values (1)'

    This should produce the same as (Notice no spacing between two commands):

    Set @strSQL = 'Create table #tmp (id int)Insert into #tmp(id) values (1)'

    I knew this had to cause some error because there's no space or semicolon between the create and insert statements but didn't know the exact error that would be produced. I've never seen any of the other specific errors so I guessed correctly but for the wrong reason.