Re: Query success in Query Analyzer but not in Reporting Services?

Tech-Archive recommends: Speed Up your PC by fixing your registry



Thanks Bruce this was most helpful

Phillip McLennan

OK, first this will not work. In RS you can use the generic query designer
and this will execute BUT you are also dropping the temp table so now it
doesn't exist which is why it isn't working for you (RS is also doing behind
the scenes work on the schema and dropping the temp tables messes this up).
It might work if you don't have the drop table but then when you execute it
again they might still be around.

When you did a stored procedure this should work. Don't drop the temp
tables, let them fall out of scope naturally.

Doing a stored procedure pick the type as stored procedure and pick the
command type as stored procedure (you will need to not use the report
wizard, just create a new dataset). For the text put in just the name of the
stored procedure, for instance: pr_mystoredprocedure

RS will detect the parameters and handle it all for you, creating report
parameters.

BTW, don't hesitate to post in the SQL Server MVP newsgroup. I hang out
there and so do several others that know RS.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services




"Jamie MacLennan (MS)" <jamiemac@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:4398aed9$1@xxxxxxxxxxxxxxxxxxxxx
Forwarding to RS group.

--

-Jamie MacLennan
SQL Server Data Mining
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Rory" <mccawr'nospam'@rogers.com> wrote in message
news:5cOdnSKZOtAl4wXeRVn-hg@xxxxxxxxxxxxx
I am struggling with a query that is giving me different results when run
in
Query Analyzer as opposed to when it is run in Report Designer.

When I run the following query in QA, and obviously declare and set the
parameters first. Wonderful - the expected results are returned in the
grid
pane. However when I run the query in Report Designer and provide the
parameters in the Define Query Parameters dialog box, I receive the
message
"x rows affected by last query" and click OK but I don't see any output
in
the grid pane????

SELECT ComputerDomain, ComputerName, NTEventID, Source, message,
TimeGenerated
INTO TMPLDAPBIND
FROM SDKEventView
WHERE [NTEventID] = 21001 AND [Source] = 'AD Client Connectivity' AND
[ComputerDomain] = 'RCI' AND [TimeGenerated] > @stime AND
[TimeGenerated] < @etime AND [ComputerName] = @DC
AND
[Message] LIKE 'The bind to%'
(SELECT ComputerDomain, ComputerName,
CONVERT(INT, replace(substring(Message, 5 + (CHARINDEX('took', Message)),
5), 'm', '')) AS TLDAP,
Message, TimeGenerated
INTO LDAPBIND
FROM TMPLDAPBIND)
(SELECT *
FROM LDAPBIND) DROP TABLE TMPLDAPBIND
DROP TABLE LDAPBIND

I have also tried to run this in a stored procedure but that fails with
the
message "Procedure has no parameters and arguments were supplied".

Any ideas or suggestions would be most welcome and I greatly appreciate
and
thank you in advance!!!

Rory McCaw
MOM MVP
Blog: http://spaces.msn.com/members/RoryMcCaw/

This is a cross-post, i have also posted to
microsoft.public.sqlserver.reportingsvcs





.



Relevant Pages

  • Re: Ways to keep database size small
    ... "John W. Vinson" wrote: ... or temp tables differently in such a case that the access database ... DON'T, since a SELECT query may get you the same result), consider putting the ... note that if you're creating a table just so that you can base a report ...
    (microsoft.public.access.modulesdaovba)
  • RE: Use values from a form as criteria in a DSum
    ... You can make sure rows are added to any query by creating a new query and ... The report that I am trying to populate is a "fake" crosstab or grid like ... set the record source of the report to the temp table because in addition I ...
    (microsoft.public.access.reports)
  • Re: ODBC call failed
    ... The UNION ... >to convert this monster query to a stored procedure, ... >report itself, don't put those in the stored procedure. ...
    (microsoft.public.sqlserver.odbc)
  • Re: Selecting records manually
    ... in testing this I didn't have to "add" these records to the temp ... This would also make it easy to show all records in the report by ... "Wayne Morgan" wrote in message ... Add this table to the query supplying this form. ...
    (microsoft.public.access.formscoding)
  • Re: force query to show month with no data
    ... SELECT monthfield As Month, yearfield As Year, nzAs Total ... Another way I have approached similar problems in the past: Put the report ... data in a temp table and add 'dummy' records directly to the table. ... > same query I have got a month field and a yearfield. ...
    (microsoft.public.access.queries)