Saturday, February 25, 2012

Annoying behavior in report designer

I have a report with a complex dataset query that involves a temp table. Anytime I make a change to that query and save or change tabs, I get this message:

Could not generate a list of fields for the query.
Invalid object name #[temp table name]. (Error 208)

Fair enough, but the real nuisance is that every time this happens it erases all of the dataset parameters I have previously set up. I have to redefine them every time.

I hope this behavior changes in the future.

I'm using technique like this:

IF (OBJECT_ID('#temp') IS NOT NULL)
DROP TABLE #temp
...
SELECT * from Table INTO #temp

|||

I assume you mean the SELECT INTO would avoid this behavior? Unfortunately I don't think that's an option for me as I'm retrieving the data set for the table from a stored procedure, i.e.

INSERT #temp
EXEC GetTempRecords @.Param1

|||As far as I know, INSERT does not create table, but SELECT INTO does

No comments:

Post a Comment