Showing posts with label created. Show all posts
Showing posts with label created. Show all posts

Friday, March 30, 2012

Rownumber with grouping

Hi everyone

I'm having a problem that I hope someone will be able to help me with. I've created a report with a table, and using =Rownumber(nothing) to give each row a number - this works fine.

Now, however, I'm trying to create a summary report. So I've introduced grouping on one of the columns, but unfortunately the Rownumber command now doesn't seem to be taking that into account, and still showing the original row numbers. So basically I'm ending up with numbers like 2, 6, 9, 15, etc.

I've tried changing the scope from nothing to the row name and to the group name, but they all do the same thing.

Does anyone know how to solve this?

Thanks,
Matt

The grouping should make the row numbers add up properly. Are you putting the group name within double quotes, like this?

=RowNumber("MyGroupName")|||

Thanks for your reply Darrell.

Yes I am using double quotes like that. Anything else gives me a syntax error when i try to run it.

Any other thoughts. I can't work out what the problem is here. Would it help if I posted a copy of my report?

|||

Hi again

I apologise if I'm sounding petulant here, but I really am at a loss. I can't find any information anywhere on the web, and I can't work out what else I could be doing wrong. If anyone has any ideas I would really appreciate hearing them.

Thanks,
Matt

|||did you ever solve this? i am having the same challenge. there is a serious lack of documentation on this.|||

Just solved this a few minutes ago. I love it when I answer my own questions.

The key is to use CountDistinct on the value you are grouping on. So use:

=RunningValue(Fields!YourGroupField.Value, CountDistinct, Nothing)

For my whole write-up, visit:

http://maxqtech.com/CS/blogs/david_leibowitz/archive/2006/08/22/3372.aspx

David Leibowitz

Business Intelligence Practice Manager

MaxQ Technologies

|||

Hey David

Thanks for your reply. I never did get it sorted out, so I appreciate your solution. Will remember it for next time :)

Matt

Friday, March 23, 2012

Row Total and Column Total in MS Visual Studio report designer 2005

Hi All,

I am using Visual Studio 2005 report desingner and SQL 2005. I have created one matrix report, but i want to insert the column total and row total.

or atleast column total

How do i do that ?

COLUMN1 COLUMN2 COLUMN3

qty amt qty amt qty amt

XXXX 2 11.00 3 22.00 34 23.50

YYYYY 3 22.00 5 27.00 35 33.50

How to do the colunm total.

Regards

Saleem

Assuming you have dynamic column and row groups, you can just right-click on the group and select "Subtotal" from the context menu.

See also: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rscreate/htm/rcr_creating_structure_objects_v1_7vi0.asp (scroll to the bottom section of "Adding Subtotals")

-- Robert

Row size limitations of SQL Server 2005

I've created a database design and I'm trying to figure out if it's workable or not. I have 2 tables in particular that are sparse (20 columns, but only a few have data - about 100 bytes/row) but will grow very large - to the tune of 700 million rows.

My question is whether or not there is a problem with SQL Server 2005 having 1.5+ billion rows of data even though it will likely only take up 100 gigs or so on disk. Anyone have experience in large numbers of rows like this? We're still doing testing as far determining how slow queries will get.

Thanks,

Craig

That's fine. SQL Server can deal with that many rows of data. I've worked with tables with billions of rows before. Don't forget to plan for your index space as well and any necessary index maintenance.

-Sue

|||

Try the link below for the SQL Server Max CAP.

http://msdn2.microsoft.com/en-us/library/ms143432.aspx

Row size in SS7

Hello,
I created a table and got the following:
The total row size (15676) for table 'MyTable' exceeds the maximum number of
bytes per row (8060). Rows that exceed the maximum number of bytes will not
be added.
I have a 5 fields that are set to varchar (2000) plus some others. Should I
use the text data type? I was reading that the text data is not stored in
the table but in a separate page. Will this be a problem in doing searches
and pushing data to the web using stored procedures and ASP?
--
Thanks in advance,
StevenUsing the text datatype won't cause you any problems searching or pushing
data; the data's physical storage is of no concern to you when querying the
data.
Whether or not you SHOULD use it is an architectural question that I can't
answer without more information about what kind of database you're building
and what the columns will be used for.
"Steven K" <skaper@.troop.com> wrote in message
news:O82Zp1XpDHA.2268@.TK2MSFTNGP12.phx.gbl...
> Hello,
> I created a table and got the following:
> The total row size (15676) for table 'MyTable' exceeds the maximum number
of
> bytes per row (8060). Rows that exceed the maximum number of bytes will
not
> be added.
> I have a 5 fields that are set to varchar (2000) plus some others. Should
I
> use the text data type? I was reading that the text data is not stored in
> the table but in a separate page. Will this be a problem in doing
searches
> and pushing data to the web using stored procedures and ASP?
> --
> Thanks in advance,
> Steven
>|||Using varchar datatype you can have a "declared" row length of larger than
8060. As long as the total combined REAL DATA length does not exceed the
limit, you are fine -- with some composite index you may receive a warning.
However, when the real length of data for a record exceeds the limit, you
will have to use text, ntext or image type. Have a look at "Managing ntext,
text, and image Data" in BOL.
"Steven K" <skaper@.troop.com> wrote in message
news:O82Zp1XpDHA.2268@.TK2MSFTNGP12.phx.gbl...
> Hello,
> I created a table and got the following:
> The total row size (15676) for table 'MyTable' exceeds the maximum number
of
> bytes per row (8060). Rows that exceed the maximum number of bytes will
not
> be added.
> I have a 5 fields that are set to varchar (2000) plus some others. Should
I
> use the text data type? I was reading that the text data is not stored in
> the table but in a separate page. Will this be a problem in doing
searches
> and pushing data to the web using stored procedures and ASP?
> --
> Thanks in advance,
> Steven
>sql

Row Size Exceeds - Help!

Hi ,
Can any one of you tell why the below warning message
appears. I have found this when i created a table. Also I
would like to know what are the side effects on this table
& DB, because of this warning.
Warning: The table 'RawMailList' has been created but its
maximum row size (13415) exceeds the maximum number of
bytes per row (8060). INSERT or UPDATE of a row in this
table will fail if the resulting row length exceeds 8060
bytes.
Best Regards
ThirumalSQL Server has a MAX row length of 8060 bytes. You can define a table that
exceeds this as you have done but should you UPDATE/INSERT and go over 8060
bytes in total then that INSERT/UPDATE will fail.
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Thirumal" <treddym@.hotmail.com> wrote in message
news:05c701c33eda$39f0a250$a301280a@.phx.gbl...
> Hi ,
> Can any one of you tell why the below warning message
> appears. I have found this when i created a table. Also I
> would like to know what are the side effects on this table
> & DB, because of this warning.
> Warning: The table 'RawMailList' has been created but its
> maximum row size (13415) exceeds the maximum number of
> bytes per row (8060). INSERT or UPDATE of a row in this
> table will fail if the resulting row length exceeds 8060
> bytes.
> Best Regards
> Thirumal|||Thirumal,
You probably have several variable-length columns--type varchar() or
nvarchar(), in each row. For example, if you have three varchar(8000)
columns in a single row, they could account for 24,000 bytes of data in
that row if each contained an 8000-byte string. So long as all the data
in any single row does not exceed 8060 bytes, there won't be a problem,
but if you tried to update the varchar() strings to the point where the row
would contain more than 8060 bytes in all, you would get an error.
The warning is just that, a warning. There is no problem at all so long
as you keep each complete row of the table within the 8060 byte limit.
By the way, the reason for this restriction is that SQL Server uses data
pages of 8K bytes (8192 bytes), and the architecture does not allow a
row to span more than one data page. 8060 bytes of data, together with
the additional information that must be on a data page, fits on one 8K page.
More information simply doesn't fit.
Steve Kass
Drew University
Thirumal wrote:
>Hi ,
>Can any one of you tell why the below warning message
>appears. I have found this when i created a table. Also I
>would like to know what are the side effects on this table
>& DB, because of this warning.
>Warning: The table 'RawMailList' has been created but its
>maximum row size (13415) exceeds the maximum number of
>bytes per row (8060). INSERT or UPDATE of a row in this
>table will fail if the resulting row length exceeds 8060
>bytes.
>Best Regards
>Thirumal
>|||Hi Allan and Steve,
Thanks a ton for clearing my doubts!!
Warm Regards
Thirumal
>--Original Message--
>Thirumal,
> You probably have several variable-length columns--type
varchar() or
>nvarchar(), in each row. For example, if you have three
varchar(8000)
>columns in a single row, they could account for 24,000
bytes of data in
>that row if each contained an 8000-byte string. So long
as all the data
>in any single row does not exceed 8060 bytes, there won't
be a problem,
>but if you tried to update the varchar() strings to the
point where the row
>would contain more than 8060 bytes in all, you would get
an error.
> The warning is just that, a warning. There is no
problem at all so long
>as you keep each complete row of the table within the
8060 byte limit.
> By the way, the reason for this restriction is that SQL
Server uses data
>pages of 8K bytes (8192 bytes), and the architecture does
not allow a
>row to span more than one data page. 8060 bytes of data,
together with
>the additional information that must be on a data page,
fits on one 8K page.
>More information simply doesn't fit.
>Steve Kass
>Drew University
>Thirumal wrote:
>>Hi ,
>>Can any one of you tell why the below warning message
>>appears. I have found this when i created a table. Also
I
>>would like to know what are the side effects on this
table
>>& DB, because of this warning.
>>Warning: The table 'RawMailList' has been created but
its
>>maximum row size (13415) exceeds the maximum number of
>>bytes per row (8060). INSERT or UPDATE of a row in this
>>table will fail if the resulting row length exceeds 8060
>>bytes.
>>Best Regards
>>Thirumal
>>
>.
>

Wednesday, March 21, 2012

Row Numbering...

Good Day everyone...

I created a simple report for getting the top selling items of a store. I am getting the report well but my team mate requested to include a number at the first column that will hold the ranking of the item. Is there a function for including a rowrank or someway that i can add a column to my query that will provide the rowrank. Please show me how... c",)

thanks in advance guys...

Hi,

Try adding a column wuth this code inside:

=RowNumber(Nothing)
|||

it works. i also thougth of that Rownumber function before, I just dont know what parameter to pass...

Maraming salamat po...

(Thank you very much in Philippines)

|||

DavePH wrote:

it works. i also thougth of that Rownumber function before, I just dont know what parameter to pass...

Maraming salamat po...

(Thank you very much in Philippines)

sql

Tuesday, March 20, 2012

row length exceeds 8060 bytes

Hi All,

I have created a table in sql server 2000 where at the time of creating
it, the row size excced 8K. I understand why I get the warning below:

The table 'tbl_detail' has been created but its maximum row size
(12367) exceeds the maximum number of bytes per row (8060). INSERT or
UPDATE of a row in this table will fail if the resulting row length
exceeds 8060 bytes.

However, when I call a stored procedure from my ASP Code, which returns
me this warning, my ASP page displays the warning and does not move to
the next line.

What can I do not to get this warning? How do I turn off warning
messages? I tried to wrap my stored procedure call code within SET
NOCOUNT ON and SET NOCOUNT OFF but that didn't help.

Any help would be really appreciated,
Thanks,
BorisYou know, I don't know how to turn errors off; wouldn't it be a better
idea to handle the error, rather than turning it off?

Another question I would have is why ignore the error; if your dataset
is that large, have you considered a 1-to-1 join, or perhaps replacing
some of your varchar fields with text?

Just asking.|||Thanks for quick reply,

Well, chaning the table structure would be a lot more difficult, since
that table name is used in a lots of places and within many stored
procedures.

I want to keep the error on, since I am handling errors. It is the
warning that I want to ignore. Now I don't know if errors and warnings
are treated and returned in the same way or not.

Either way, if I don't turn off the warning, how do I handle that
warning? Is there a warning # or something I can check?

Thanks in advance,
Boris

Stu wrote:
> You know, I don't know how to turn errors off; wouldn't it be a better
> idea to handle the error, rather than turning it off?
> Another question I would have is why ignore the error; if your dataset
> is that large, have you considered a 1-to-1 join, or perhaps replacing
> some of your varchar fields with text?
> Just asking.|||Boris (supermanreloaded@.gmail.com) writes:
> I have created a table in sql server 2000 where at the time of creating
> it, the row size excced 8K. I understand why I get the warning below:
> The table 'tbl_detail' has been created but its maximum row size
> (12367) exceeds the maximum number of bytes per row (8060). INSERT or
> UPDATE of a row in this table will fail if the resulting row length
> exceeds 8060 bytes.
> However, when I call a stored procedure from my ASP Code, which returns
> me this warning, my ASP page displays the warning and does not move to
> the next line.
> What can I do not to get this warning? How do I turn off warning
> messages? I tried to wrap my stored procedure call code within SET
> NOCOUNT ON and SET NOCOUNT OFF but that didn't help.

You cannot turn off the warning on the SQL Server side.

I am a little surprised that ASP stops on the warning. Usually ADO
swallows informational messages completely. You could customize the
error handler in the ASP code, to check on the error number, and
ignore this message.

However, there is something fishy here. If the table already exists,
running the stored procedure should not give you the warning. So I
suspect one three things:

1) You are creating a temp table in the SP which also possibly could
exceed 8K. In this case, you could as a last resort split up the
temp table into two.
2) You insert data that exceeds 8K, so you actually get an error, not
a warning.
3) You are dropping and recreating tbl_detail. Dynamically changing the
schema is usuaally poor design.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks Erland,

1 and 2 are not true, however, I am creating and dropping table
dynamically. And when my stored procedure tries to an update operation
on that temp_detail table, it issues the warning. Now the table does
get updated, as I have tested it. When I run the stored procedure
outside ASP (in query analyzer), I see the same message. Its just that
it does not fail. The ASP Code however stops at the warning message,
which is surprising to me too.

Since I can not turn off that warning message, I guess I need to do the
error handling, or warning handling in my ASP code. I just need to know
how. If you know how can I do that, please let me know. Any help would
be really appreciated.

As far as changing the table structure and spiliting in two tables, it
is almost impossible. That table name has been used at many different
places. Everyone would have to change the logic in that case.

Thanks,
Boris

Erland Sommarskog wrote:
> Boris (supermanreloaded@.gmail.com) writes:
> > I have created a table in sql server 2000 where at the time of creating
> > it, the row size excced 8K. I understand why I get the warning below:
> > The table 'tbl_detail' has been created but its maximum row size
> > (12367) exceeds the maximum number of bytes per row (8060). INSERT or
> > UPDATE of a row in this table will fail if the resulting row length
> > exceeds 8060 bytes.
> > However, when I call a stored procedure from my ASP Code, which returns
> > me this warning, my ASP page displays the warning and does not move to
> > the next line.
> > What can I do not to get this warning? How do I turn off warning
> > messages? I tried to wrap my stored procedure call code within SET
> > NOCOUNT ON and SET NOCOUNT OFF but that didn't help.
> You cannot turn off the warning on the SQL Server side.
> I am a little surprised that ASP stops on the warning. Usually ADO
> swallows informational messages completely. You could customize the
> error handler in the ASP code, to check on the error number, and
> ignore this message.
> However, there is something fishy here. If the table already exists,
> running the stored procedure should not give you the warning. So I
> suspect one three things:
> 1) You are creating a temp table in the SP which also possibly could
> exceed 8K. In this case, you could as a last resort split up the
> temp table into two.
> 2) You insert data that exceeds 8K, so you actually get an error, not
> a warning.
> 3) You are dropping and recreating tbl_detail. Dynamically changing the
> schema is usuaally poor design.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp|||Boris (supermanreloaded@.gmail.com) writes:
> 1 and 2 are not true, however, I am creating and dropping table
> dynamically.

So this where you would concentrate on changing things. I would
never permit tables being created dynamically in databases I am
responsible for.

If all you want to do is to clear out the table, just use TRUNCATE
TABLE instead.

But what happens if two instances of that ASP page runs at the same
time.

> Since I can not turn off that warning message, I guess I need to do the
> error handling, or warning handling in my ASP code. I just need to know
> how. If you know how can I do that, please let me know. Any help would
> be really appreciated.

You are likely to know more ASP than I do, because I know nothing about
ASP. (It's a tree, isn't it? :-)

But assuming that you use ADO as the client library, you can check
the Errors collection for errors. The Error object has a .Number
property, and this is the error number from SQL Server. Which number
you should check for, I don't know, but that's very easy to find
out.

If you have more detailed questions about ASP programming, you are
definitely better of in an ASP forum.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Cant the table be split into two, then create a VIEW to join the two
tables. If you use the current table's name as the view, then the other
procedures wont know the difference?
I could be way off base..
hth

Saturday, February 25, 2012

Round 2...

I am VERY new to reporting services, so I think this should be an easy one.
I created a simple report that uses a SPROC as the dataset. There are 2
input parameters for the SPROC...
1) a Dealer number
2) a Inventory number.
The dealers are uploading pictures of the inventory items onto my server
into a folder.
The structure of the folder is as follows.
http://mywebsite.com/dealers/DEALER NUMBER/invetorypics/INVENTORY NUMBER.jpg
I am reposting - nobody answered the first time...
I have code so when the dealer uploads a picture of the piece of invetory,
the inventory number becomes the name of the image.
Example... dealer number is 1234 and the inventory number is 5678
The image is saved to this location, with this file name...
http://mywebsite.com/dealers/1234/autopics/5678.jpg
so here is my question... on a report that I run to show a specific piece of
inventory (including the image), how do I dynamically populate the "value"
property of my image control? I say dynamically, because the path of the
'value' property is built using the 2 input parameters (the user is
supplying the parameters under the covers by clicking a row in a grid).
so in the above case, the "value" property needs to be set to
http://mywebsite.com/dealers/1234/autopics/5678.jpg
Thanks in advance!
BrianSet the Image.Value property to this expression:
=http://mywebsite.com/dealers/ & Parameters!DealerNumber.Value &
"/autopics/" & Parameters!InventoryNumber.Value & ".jpg"
(the "http...dealers/" should be in quotes, but OE likes to remove quotes
and make a hyperlink)
--
Floyd
"Brian Cesafsky" <Brian.Cesafsky@.AutoTrackerPlus.com> wrote in message
news:%23d5f7QDnFHA.3544@.TK2MSFTNGP15.phx.gbl...
>I am VERY new to reporting services, so I think this should be an easy one.
> I created a simple report that uses a SPROC as the dataset. There are 2
> input parameters for the SPROC...
> 1) a Dealer number
> 2) a Inventory number.
> The dealers are uploading pictures of the inventory items onto my server
> into a folder.
> The structure of the folder is as follows.
> http://mywebsite.com/dealers/DEALER NUMBER/invetorypics/INVENTORY
> NUMBER.jpg
> I am reposting - nobody answered the first time...
>
> I have code so when the dealer uploads a picture of the piece of invetory,
> the inventory number becomes the name of the image.
> Example... dealer number is 1234 and the inventory number is 5678
> The image is saved to this location, with this file name...
> http://mywebsite.com/dealers/1234/autopics/5678.jpg
>
> so here is my question... on a report that I run to show a specific piece
> of
> inventory (including the image), how do I dynamically populate the "value"
> property of my image control? I say dynamically, because the path of the
> 'value' property is built using the 2 input parameters (the user is
> supplying the parameters under the covers by clicking a row in a grid).
> so in the above case, the "value" property needs to be set to
> http://mywebsite.com/dealers/1234/autopics/5678.jpg
> Thanks in advance!
> Brian
>
>|||I tried this, but it is not working, I don't get the image...
"Floyd Burger" <mrlements@.community.nospam> wrote in message
news:u6SnWhEnFHA.1948@.TK2MSFTNGP12.phx.gbl...
> Set the Image.Value property to this expression:
> =http://mywebsite.com/dealers/ & Parameters!DealerNumber.Value &
> "/autopics/" & Parameters!InventoryNumber.Value & ".jpg"
> (the "http...dealers/" should be in quotes, but OE likes to remove quotes
> and make a hyperlink)
> --
> Floyd
> "Brian Cesafsky" <Brian.Cesafsky@.AutoTrackerPlus.com> wrote in message
> news:%23d5f7QDnFHA.3544@.TK2MSFTNGP15.phx.gbl...
>>I am VERY new to reporting services, so I think this should be an easy
>>one.
>> I created a simple report that uses a SPROC as the dataset. There are 2
>> input parameters for the SPROC...
>> 1) a Dealer number
>> 2) a Inventory number.
>> The dealers are uploading pictures of the inventory items onto my server
>> into a folder.
>> The structure of the folder is as follows.
>> http://mywebsite.com/dealers/DEALER NUMBER/invetorypics/INVENTORY
>> NUMBER.jpg
>> I am reposting - nobody answered the first time...
>>
>> I have code so when the dealer uploads a picture of the piece of
>> invetory,
>> the inventory number becomes the name of the image.
>> Example... dealer number is 1234 and the inventory number is 5678
>> The image is saved to this location, with this file name...
>> http://mywebsite.com/dealers/1234/autopics/5678.jpg
>>
>> so here is my question... on a report that I run to show a specific piece
>> of
>> inventory (including the image), how do I dynamically populate the
>> "value"
>> property of my image control? I say dynamically, because the path of the
>> 'value' property is built using the 2 input parameters (the user is
>> supplying the parameters under the covers by clicking a row in a grid).
>> so in the above case, the "value" property needs to be set to
>> http://mywebsite.com/dealers/1234/autopics/5678.jpg
>> Thanks in advance!
>> Brian
>>
>