Showing posts with label retrieve. Show all posts
Showing posts with label retrieve. Show all posts

Thursday, March 29, 2012

Field list is empty when calling stored procedure

Hello!
I am having problems retrieving list of fields when using stored
procedure as Dataset Source. I noticed that Reporting Services can retrieve
field list if stored procedure is trivial (simple select etc.). In my case,
I am insrting into temporary table and after some manipulations return
resultset. SQL Trace show that RS tries to execute SET FMTONLY ON <sp_name>
SET FMTONLY OFF when reading list of the fiels. This returns empty result
for my stored procedure.
I can not move any further without field list being populated properly. I
can try to replace stored procedure with the view etc. but I would really
like to know if someone experienced similar problems.
Any help is greately appreciated,
IgorIgor,
I have experienced that same behavior. The stored procedure will run but
I will not get a field list. I received the error that told me to hit
REFRESH to get the fields list ... I returned to the data tab, ran the
procedure and hit the refresh button ... then when I returned to layout tab
... the fields list was there. Otherwise I have read in books that you have
to type in your own fields list which to me was not a very acceptable answer
as my fields list was quite extensive. Hope that helps you!
MJ
"imarchenko" wrote:
> Hello!
> I am having problems retrieving list of fields when using stored
> procedure as Dataset Source. I noticed that Reporting Services can retrieve
> field list if stored procedure is trivial (simple select etc.). In my case,
> I am insrting into temporary table and after some manipulations return
> resultset. SQL Trace show that RS tries to execute SET FMTONLY ON <sp_name>
> SET FMTONLY OFF when reading list of the fiels. This returns empty result
> for my stored procedure.
> I can not move any further without field list being populated properly. I
> can try to replace stored procedure with the view etc. but I would really
> like to know if someone experienced similar problems.
> Any help is greately appreciated,
> Igor
>
>

Sunday, February 26, 2012

Fast counting of records

I seem to remember reading many moons ago about a function where you
can retrieve a count of the last recordset you opened.

For example:

I've got a stored procedure that returns a recordset using the TOP 10
so I only get the top 10 records. I need to know the recordcount but I
dont want to reuse the SELECT statement because its quite complex.

Any ideas?

What does @.@.Count do?

Thanks in advance"Samuel Hon" <noreply@.samuelhon.co.uk> wrote in message
news:c8672b7d.0309110815.2fba8c32@.posting.google.c om...
> I seem to remember reading many moons ago about a function where you
> can retrieve a count of the last recordset you opened.
> For example:
> I've got a stored procedure that returns a recordset using the TOP 10
> so I only get the top 10 records. I need to know the recordcount but I
> dont want to reuse the SELECT statement because its quite complex.
> Any ideas?
> What does @.@.Count do?
> Thanks in advance

@.@.ROWCOUNT

Simon