I can't use SP_EXECUTELSQL since it is limited to 4000 characters; I have to use EXEC (@my_dynamic_sql_statement), because I'm using up to 8000 characters (there are some long lists).
I've been using @@ROWCOUNT, but I have to run the select statement in order to retrieve the rowcount. Since I have to use dynamic SQL, I can only use a...