• ChrisM@home (10/11/2012)


    The filter is being applied locally. You could use EXEC with dynamic SQL as Chandan suggests; I'd personally use OPENQUERY, which will also require your statement to be constructed as a string (OPENQUERY doesn't accept variables).

    I agree with you. I prefer openquery more but I did not want to make things more complex and wanted to retain the same version with what Yusuf came up with.

    Chandan