here is today's hair pulling exercise. I created a very simple sql query (the one I was using too complex to see the problem clearly). note below:
when executed in sql server management studio, the query runs as expected. it just grabs resourceid and system name, puts them into a temporary table, and draws them right back out. however, when executed in bids (business intelligence development studio), you receive the error stating "the variable name has already been declared. variable names must be unique within a query batch or stored procedure."
right thanks. so after much chasing geese wildly, I discovered that while windows is decidedly case insensitive, sometimes it changes its mind. in visual studio (bids, etc) it appears that the case used for variables with respect to temporary tables is sensitive!
so, back to the simple query, here's the revised change. just keep your case the same.