When parameterized query is used against older SQL Server versions, like SQL Server 2008 and earlier, reports containing a text filer may fail. You may receive a report execution error, such as a "drop table error," as shown below:

Pre-condtions:


The issue can be reproduced with the Strategy Tutorial project and the following steps:


Pass0 - select a11.CUSTOMER_ID CUSTOMER_ID, sum(a11.TOT_COST) WJXBFS1 into #ZZTPW00005YMD000 from CUSTOMER_SLS a11 join LU_CUSTOMER a12 on (a11.CUSTOMER_ID = a12.CUSTOMER_ID) where a12.CUST_LAST_NAME = 'James' group by a11.CUSTOMER_ID Pass1 - select a12.ZIPCODE ZIPCODE, sum(a11.TOT_COST) WJXBFS1 into #ZZTPW00005YMD001 from CUSTOMER_SLS a11 join LU_CUSTOMER a12 on (a11.CUSTOMER_ID = a12.CUSTOMER_ID) where a12.CUST_LAST_NAME = 'James' group by a12.ZIPCODE

Pass0 - select a11.CUSTOMER_ID CUSTOMER_ID, sum(a11.TOT_COST) WJXBFS1 into #ZZTPW00005WMD000 from CUSTOMER_SLS a11 join LU_CUSTOMER a12 on (a11.CUSTOMER_ID = a12.CUSTOMER_ID) where a12.CUST_LAST_NAME = ? group by a11.CUSTOMER_ID with parameters: James Pass1 - select a12.ZIPCODE ZIPCODE, sum(a11.TOT_COST) WJXBFS1 into #ZZTPW00005WMD001 from CUSTOMER_SLS a11 join LU_CUSTOMER a12 on (a11.CUSTOMER_ID = a12.CUSTOMER_ID) where a12.CUST_LAST_NAME = ? group by a12.ZIPCODE with parameters: James
In some older versions of the SQL Server database, you are not allowed to create tables using parameterized queries.
With the SQL Server Warehouse default setting, whenever the Engine needs to create a temp table, it will use the implicit table creation, meaning it uses a syntax like
SELECT … INTO #TEMP_TABLE. If there is a filter applied in the report, the syntax will contain a
WHEREclause.
You should edit the Table Creation Type VLDB setting to use explicit table.

After the VLDB setting is changed to explicit and the
CREATEtable statement no longer contains parameters, the following SQL is generated:
create table #ZZTPW00007UMD000( CUSTOMER_ID SMALLINT, WJXBFS1 FLOAT) Pass1 - insert into #ZZTPW00007UMD000 select a11.CUSTOMER_ID CUSTOMER_ID, sum(a11.TOT_COST) WJXBFS1 from CUSTOMER_SLS a11 join LU_CUSTOMER a12 on (a11.CUSTOMER_ID = a12.CUSTOMER_ID) where a12.CUST_LAST_NAME = ? group by a11.CUSTOMER_ID with parameters: James
