Hi I am trying to optimize some procs that use temp table variables. It is very easy I see to use regular temp tables but I cannot get it to work with temp table variables.
Do you mean your temp table creation script includes bind variables?
Before you optimize your SQL statement, please create the referenced temp tables in Temp Table Manager(you can click ‘Temp Tables’ at the top of SQL Editor). if your temp table creation script includes the bind variables, it will show a Set Bind Variable window when to press ‘Save to Session File’ button. You can set data type and values for your bind variables. After the temp table defination is saved to the optimization session, you should be able to optimize your SQL statement referencing temp tables.
What is the version of Quest SQL Optimizer for SQL Server you use?