Wednesday, March 21, 2012

Line Numbers in SQL

Is there a function I can put into my select clause that tell me what the
line number of the row is?
i.e. in Oracle you can do something like (Been a year since I've used
Oracle)
select rownum, Field1, Field2
from blah
Any help is appreciated. Thanks.No, you could do something with a temp table and IDENTITY. I believe Yukon
has the rownumber function. What do you need it for?
Ray Higdon MCSE, MCDBA, CCNA
--
"Scott Meddows" <scott_meddows_no_spm@.tsged-removeme.com> wrote in message
news:uTDWhna8DHA.1052@.TK2MSFTNGP12.phx.gbl...
> Is there a function I can put into my select clause that tell me what the
> line number of the row is?
> i.e. in Oracle you can do something like (Been a year since I've used
> Oracle)
> select rownum, Field1, Field2
> from blah
> Any help is appreciated. Thanks.
>|||It's the only way I can think of to alternate row colors in reporting
services...
"Ray Higdon" <sqlhigdon@.nospam.yahoo.com> wrote in message
news:%233NMuic8DHA.1548@.tk2msftngp13.phx.gbl...
> No, you could do something with a temp table and IDENTITY. I believe Yukon
> has the rownumber function. What do you need it for?
> --
> Ray Higdon MCSE, MCDBA, CCNA
> --
> "Scott Meddows" <scott_meddows_no_spm@.tsged-removeme.com> wrote in message
> news:uTDWhna8DHA.1052@.TK2MSFTNGP12.phx.gbl...
the
>|||you should have a look at the subject "row style in matrix" in
microsoft.public.sqlserver.reportingsvcs
Jean-Philippe.
"Scott Meddows" <scott_meddows_no_spm@.tsged-removeme.com> a crit dans le
message de news:eDztD6e8DHA.2404@.TK2MSFTNGP12.phx.gbl...
> It's the only way I can think of to alternate row colors in reporting
> services...
> "Ray Higdon" <sqlhigdon@.nospam.yahoo.com> wrote in message
> news:%233NMuic8DHA.1548@.tk2msftngp13.phx.gbl...
Yukon
message
> the
>|||I don't seem to have a message with that title and the newsgroup is not in
Google groups yet...
"Jean Philippe Vankemmel" <vankemjp@.ifrance.com> wrote in message
news:%23zh0zZG9DHA.452@.TK2MSFTNGP11.phx.gbl...
> you should have a look at the subject "row style in matrix" in
> microsoft.public.sqlserver.reportingsvcs
> Jean-Philippe.
> "Scott Meddows" <scott_meddows_no_spm@.tsged-removeme.com> a crit dans le
> message de news:eDztD6e8DHA.2404@.TK2MSFTNGP12.phx.gbl...
> Yukon
> message
what
used
>|||See here - http://www.microsoft.com/sql/commun...ups/default.asp
Ray Higdon MCSE, MCDBA, CCNA
--
"Scott Meddows" <scott_meddows_no_spm@.tsged-removeme.com> wrote in message
news:%23k0kO%23K9DHA.4060@.tk2msftngp13.phx.gbl...
> I don't seem to have a message with that title and the newsgroup is not in
> Google groups yet...
> "Jean Philippe Vankemmel" <vankemjp@.ifrance.com> wrote in message
> news:%23zh0zZG9DHA.452@.TK2MSFTNGP11.phx.gbl...
le
> what
> used
>|||Nothing there, either..
Doesn't come up in search.
"Ray Higdon" <sqlhigdon@.nospam.yahoo.com> wrote in message
news:eKr4rHL9DHA.400@.tk2msftngp13.phx.gbl...
> See here - http://www.microsoft.com/sql/commun...ups/default.asp
> --
> Ray Higdon MCSE, MCDBA, CCNA
> --
> "Scott Meddows" <scott_meddows_no_spm@.tsged-removeme.com> wrote in message
> news:%23k0kO%23K9DHA.4060@.tk2msftngp13.phx.gbl...
in
> le
reporting
believe
>|||Nothing there? I just went to it, it's toward the bottom of the page, search
for "reporting services"
Ray Higdon MCSE, MCDBA, CCNA
--
"Scott Meddows" <scott_meddows_no_spm@.tsged-removeme.com> wrote in message
news:uVp1YYL9DHA.2712@.tk2msftngp13.phx.gbl...
> Nothing there, either..
> Doesn't come up in search.
> "Ray Higdon" <sqlhigdon@.nospam.yahoo.com> wrote in message
> news:eKr4rHL9DHA.400@.tk2msftngp13.phx.gbl...
message
not
> in
dans
> reporting
> believe
in
me
I've
>|||you should have a look at the subject "row style in matrix" in
That is what I'm looking up in that newsgroup. I can find the reporting
services newsgroup.
"Ray Higdon" <sqlhigdon@.nospam.yahoo.com> wrote in message
news:%23yp%23tcL9DHA.548@.TK2MSFTNGP11.phx.gbl...
> Nothing there? I just went to it, it's toward the bottom of the page,
search
> for "reporting services"
> --
> Ray Higdon MCSE, MCDBA, CCNA
> --
> "Scott Meddows" <scott_meddows_no_spm@.tsged-removeme.com> wrote in message
> news:uVp1YYL9DHA.2712@.tk2msftngp13.phx.gbl...
http://www.microsoft.com/sql/commun...ups/default.asp
> message
> not
> dans
wrote
> in
tell
> me
> I've
>|||Ah, OK.
I use NNTP and searched and found it, this is the excerpt: (See below)
You will need to add an expression the outer most row grouping on the
matrix.
The attached sample report demonstrates how to do this.
Key Areas:
* Matrix Properties Dialog : Groups Tab : Country Group has an expression
on it
that controls the number of rows:
=System.Math.Ceiling(RowNumber(Nothing)/5)
* Place a PageBreakAtEnd on the Matrix Properties Dialog : Groups Tab :
Country Group.
NOTE: There is a bug on this dialog in RTM version. The checkboxes to
set
PageBreakAt[Start | End] are missing. You will need to hand edit the RDL
to get this
to work. Before proceeding backup your RDL. The code snippet shows where
the
PageBreakAtEnd tag was added to the RDL:
<Grouping Name="matrix1_Country">
<GroupExpressions>
<GroupExpression>=System.Math.Ceiling(RowNumber(Nothing)/5)</GroupExpression
>
</GroupExpressions>
<PageBreakAtEnd>true</PageBreakAtEnd> <<<<<< Tag added
here.
</Grouping>
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Avi" <anonymous@.discussions.microsoft.com> wrote in message
news:B9A6926F-2CBD-4C40-9471-49422C3EA39E@.microsoft.com...
> Hi
> Is there any way by which I can specify the number of rows to be displayed
on one page in matrix?
> Suppose I want only 10 rows to be displyed on one page irrespective of
collapsed or expanded state of the groups.
> How do I achieve this?
> -Avi
Ray Higdon MCSE, MCDBA, CCNA
--
"Scott Meddows" <scott_meddows_no_spm@.tsged-removeme.com> wrote in message
news:OeKWKlO9DHA.3704@.tk2msftngp13.phx.gbl...
> you should have a look at the subject "row style in matrix" in
> That is what I'm looking up in that newsgroup. I can find the reporting
> services newsgroup.
> "Ray Higdon" <sqlhigdon@.nospam.yahoo.com> wrote in message
> news:%23yp%23tcL9DHA.548@.TK2MSFTNGP11.phx.gbl...
> search
message
> http://www.microsoft.com/sql/commun...ups/default.asp
is
crit
> wrote
> tell
since
>sql

No comments:

Post a Comment