Showing posts with label produce. Show all posts
Showing posts with label produce. Show all posts

Monday, March 26, 2012

Row_Number() fails to return anything

I am using SQLExpress and want to do some custom paging with a grid but can not get the sproc to produce any results. I don't get any error just a resultset of 0 rows whenever I include the row_number function.

Sample Table:
refID int identity increments by 1
refSubject nvarchar(100)
refBody nText

Sample sproc that works
create proc sp_RefListing as
select refid
, refsubject
from myTable

Sample Sproc that doesn't work:
with OrderedRefList as
(Select refid
,refsubject
,row_number() OVER (order by refsubject) as rownum
from myTable)
select refid
,refsubject
,rownum
from OrderedRefList
where rownum < 10

When I execute I get no errors or warnings during save, but I get no data.

Is there something I am doing wrong, is there a setting in SQLExpress I need to change to allow row_number?

Thanks in advance for your assistance,

Al


Did you ever get an answer to this question? I am having the same issue. The SPROC doesn't return anything when executed within Visual Studio 2005 Pro, but will return fine if the same query is put into a view, or if the SPROC is called from MS Access or SQL Management Studio. Appears to be a problem with Visual Studio 2005.sql

Row_Number() fails to return anything

I am using SQLExpress and want to do some custom paging with a grid but can not get the sproc to produce any results. I don't get any error just a resultset of 0 rows whenever I include the row_number function.

Sample Table:
refID int identity increments by 1
refSubject nvarchar(100)
refBody nText

Sample sproc that works
create proc sp_RefListing as
select refid
, refsubject
from myTable

Sample Sproc that doesn't work:
with OrderedRefList as
(Select refid
,refsubject
,row_number() OVER (order by refsubject) as rownum
from myTable)
select refid
,refsubject
,rownum
from OrderedRefList
where rownum < 10

When I execute I get no errors or warnings during save, but I get no data.

Is there something I am doing wrong, is there a setting in SQLExpress I need to change to allow row_number?

Thanks in advance for your assistance,

Al


Did you ever get an answer to this question? I am having the same issue. The SPROC doesn't return anything when executed within Visual Studio 2005 Pro, but will return fine if the same query is put into a view, or if the SPROC is called from MS Access or SQL Management Studio. Appears to be a problem with Visual Studio 2005.

Monday, March 12, 2012

Row Hiding in a Matrix

Hi,
I have a P&L report that I am trying to produce. Due to the many
column groups, I prefer to use the matrix method.
However, I can't seem to surpress duplicate rows that are created
because in some instances the total value of the outer row group is the
same as the total value of the inner group.
I was performing this nicely with a table by using the visibility
surpression on the entire row (which didn't get rid of the outer
group).
It seems there is no equivalence in the matrix control and when I set
the visibility of the outer group to conditionally hide none of the
inner group values seem to show (I guess this is by design)
I guess what I want to do is to surpress the visibiliy of either the
summary or the last inner group.
When I try to conditionally set the visibility of the summary, the
label is not shown but the total value is.
Either method seems to have a limitation.
Any ideas?
ThanksI tried Hide Duplicates, too, but that doesn't do anything even though
the visible fields of the two consecutive rows have identical values.