• cengland0 (12/10/2010)


    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

    Except it doesn't.

    If you copy/paste the above in an SSMS query window and hit execute, you get "Command(s) completed successfully."


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/