• Atif Sheikh (5/4/2009)


    Very Tricky...

    The last query DO NOT Execute due to the the @query variable declared as varchar(20)

    if You declare the @query variable as varchar(25), it executes.

    Nice...

    It'll execute all right, but it'll NOT produce the requested result...


    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/