Showing posts with label rows. Show all posts
Showing posts with label rows. Show all posts

Thursday, March 22, 2012

check if im reading cached data or hitting disks

I am running a query that returns more than 15 million rows.. If i run it
more than once, I want to know if the second run is being accessed directly
from cache or am I still hitting the disks just in case I am short of memory
or a combination of both ?
The query is a select statement and nothing more..
Look in BOL for SET STATISTICS IO ON / OFF
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
"Hassan" <fatima_ja@.hotmail.com> schrieb im Newsbeitrag
news:O7Y$wCLRFHA.508@.TK2MSFTNGP12.phx.gbl...
>I am running a query that returns more than 15 million rows.. If i run it
> more than once, I want to know if the second run is being accessed
> directly
> from cache or am I still hitting the disks just in case I am short of
> memory
> or a combination of both ?
> The query is a select statement and nothing more..
>

check if im reading cached data or hitting disks

I am running a query that returns more than 15 million rows.. If i run it
more than once, I want to know if the second run is being accessed directly
from cache or am I still hitting the disks just in case I am short of memory
or a combination of both ?
The query is a select statement and nothing more..Look in BOL for SET STATISTICS IO ON / OFF
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Hassan" <fatima_ja@.hotmail.com> schrieb im Newsbeitrag
news:O7Y$wCLRFHA.508@.TK2MSFTNGP12.phx.gbl...
>I am running a query that returns more than 15 million rows.. If i run it
> more than once, I want to know if the second run is being accessed
> directly
> from cache or am I still hitting the disks just in case I am short of
> memory
> or a combination of both ?
> The query is a select statement and nothing more..
>

check if im reading cached data or hitting disks

I am running a query that returns more than 15 million rows.. If i run it
more than once, I want to know if the second run is being accessed directly
from cache or am I still hitting the disks just in case I am short of memory
or a combination of both ?
The query is a select statement and nothing more..Look in BOL for SET STATISTICS IO ON / OFF
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"Hassan" <fatima_ja@.hotmail.com> schrieb im Newsbeitrag
news:O7Y$wCLRFHA.508@.TK2MSFTNGP12.phx.gbl...
>I am running a query that returns more than 15 million rows.. If i run it
> more than once, I want to know if the second run is being accessed
> directly
> from cache or am I still hitting the disks just in case I am short of
> memory
> or a combination of both ?
> The query is a select statement and nothing more..
>sql

check if field contains numeric character

How can I select all of the rows of my table for which a certain
field's value contains other characters than a-z and A-Z (non alpha
string) ?
Thank youWhere Column like '%[0-9]%'
Look up "Pattern Matching in Search Conditions" in BOL for more information.
<samuelberthelot@.googlemail.com> wrote in message
news:1148478170.488497.325220@.j33g2000cwa.googlegroups.com...
> How can I select all of the rows of my table for which a certain
> field's value contains other characters than a-z and A-Z (non alpha
> string) ?
> Thank you
>|||If it does not help ,please post your actual data + expected result
create table #t (c1 varchar(20))
insert into #t values ('cdjdfj')
insert into #t values ('cd4jdfj')
insert into #t values ('fh')
insert into #t values ('1525')
insert into #t values ('1jj')
insert into #t values ('jkk')
select * from #t where c1 like '%[0-9]%'
<samuelberthelot@.googlemail.com> wrote in message
news:1148478170.488497.325220@.j33g2000cwa.googlegroups.com...
> How can I select all of the rows of my table for which a certain
> field's value contains other characters than a-z and A-Z (non alpha
> string) ?
> Thank you
>|||found out, had to use the PATINDEX function|||Uri Dimant wrote:
> If it does not help ,please post your actual data + expected result
> create table #t (c1 varchar(20))
> insert into #t values ('cdjdfj')
> insert into #t values ('cd4jdfj')
> insert into #t values ('fh')
> insert into #t values ('1525')
> insert into #t values ('1jj')
> insert into #t values ('jkk')
>
> select * from #t where c1 like '%[0-9]%'
>
What about :
insert into test values ('!"=A3$%^&*()_')
Try this instead:
select * from #t where c1 like '%[^A-Z]%'=20
Jamie.

Monday, March 19, 2012

Check db before move items from listbox1 to listbox2 or save them into db

I have two listboxes: listbox1 retrieve rows from tblProfileUsers and listbox2 receive users from listbox1 to save them into the same table tblProfileUsers, but users must have an unique profile associate to him.

So I need that my web form checks if selected users already are on tblProfileUsers and block operation before they saved with a 2nd or 3rd profiles.

I′m using VSTS with SQL 2005.

Check out the SQLExists function.

|||

hi

first you could useselect cout statement to find that user name on those table you want and read the int , if int was 0 it means that there is no such user in that table and you could add that.

for this you could use SqlCommand , SQL connecrtion and SqlDataReaderYes

Saturday, February 25, 2012

Charting from two datasets

I have a chart that is displaying data from two datasets. Dataset #1 returns
a set of "all rows". Dataset #2 returns rows that are a subset of the
Dataset #1 with two status values - let's say "True" and "False". I wish to
display a stacked column chart with three segments - "True", "False" and
"Unknown", where unknown is the count of items from Dataset #1 that are not
represented in Dataset #2. How do I do this? What I have tried is a Series
group keyed to the status value from Dataset #2 (i.e. True, False). My data
value is labeled "Known" and is the count from Dataset #2. But when I add a
2nd data value (i.e. "Unknown") that is the count from Dataset #1, it
effectively multiplies the series to 4 values instead of the desired 3. In
other words, I want the chart to show series values of "Known True", "Known
False" and "Unknown", instead of "Known True", "Known False", "Unknown True",
"Unknown False".You would need to join the data in your query first. Create one chart from
two datasets is not supported.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"BootieDay" <BootieDay@.discussions.microsoft.com> wrote in message
news:0198843D-B474-48E6-9280-2D90038DD765@.microsoft.com...
>I have a chart that is displaying data from two datasets. Dataset #1
>returns
> a set of "all rows". Dataset #2 returns rows that are a subset of the
> Dataset #1 with two status values - let's say "True" and "False". I wish
> to
> display a stacked column chart with three segments - "True", "False" and
> "Unknown", where unknown is the count of items from Dataset #1 that are
> not
> represented in Dataset #2. How do I do this? What I have tried is a
> Series
> group keyed to the status value from Dataset #2 (i.e. True, False). My
> data
> value is labeled "Known" and is the count from Dataset #2. But when I add
> a
> 2nd data value (i.e. "Unknown") that is the count from Dataset #1, it
> effectively multiplies the series to 4 values instead of the desired 3.
> In
> other words, I want the chart to show series values of "Known True",
> "Known
> False" and "Unknown", instead of "Known True", "Known False", "Unknown
> True",
> "Unknown False".|||Thanks Robert. It is my understanding though that supporting an aggregate
from a 2nd dataset within a single data region IS supported, it does seem to
be working, just not giving me the series organization I want. Joining is
not an option as Dataset #1 is provided by an extension DLL and Dataset #2 is
SQL.
"Robert Bruckner [MSFT]" wrote:
> You would need to join the data in your query first. Create one chart from
> two datasets is not supported.
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "BootieDay" <BootieDay@.discussions.microsoft.com> wrote in message
> news:0198843D-B474-48E6-9280-2D90038DD765@.microsoft.com...
> >I have a chart that is displaying data from two datasets. Dataset #1
> >returns
> > a set of "all rows". Dataset #2 returns rows that are a subset of the
> > Dataset #1 with two status values - let's say "True" and "False". I wish
> > to
> > display a stacked column chart with three segments - "True", "False" and
> > "Unknown", where unknown is the count of items from Dataset #1 that are
> > not
> > represented in Dataset #2. How do I do this? What I have tried is a
> > Series
> > group keyed to the status value from Dataset #2 (i.e. True, False). My
> > data
> > value is labeled "Known" and is the count from Dataset #2. But when I add
> > a
> > 2nd data value (i.e. "Unknown") that is the count from Dataset #1, it
> > effectively multiplies the series to 4 values instead of the desired 3.
> > In
> > other words, I want the chart to show series values of "Known True",
> > "Known
> > False" and "Unknown", instead of "Known True", "Known False", "Unknown
> > True",
> > "Unknown False".
>
>

Sunday, February 19, 2012

Chart Filters

HI,
Does anybody know how to write a chart filter that will return only the last row in the record set and conversely return all rows except for the last in the data set (for a separate chart)
My Report consists of a dataset that has the total in the last row. I want to create a chart with only the total row and another chart on the same page using the same data set but excluding the total row.
Cheers
KevinIf there is anything special about the row it would be straight forward as a
chart filter and a table filter to separate the rows. If the only
distinguishing feature of the row is that it is the last row then I can not
think of a way in RS 2000 to do this. We are considering allowing
aggregates of aggregates, which would allow you to filter on the max
rownumber.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kevin Wilson" <KevinWilson@.discussions.microsoft.com> wrote in message
news:A23DB1DA-C4EC-4789-A46A-C236B070F5A4@.microsoft.com...
> HI,
> Does anybody know how to write a chart filter that will return only the
last row in the record set and conversely return all rows except for the
last in the data set (for a separate chart)
> My Report consists of a dataset that has the total in the last row. I want
to create a chart with only the total row and another chart on the same
page using the same data set but excluding the total row.
> Cheers
> Kevin|||Jason,
There is nothing special about the row except that it's the last. However I've managed to created a chart filter that returns the last row by using the Bottom N operator.
expression operator value
=Fields!RH0_Product.Value BottomN =1
However do you know how to express a filter that defines where the rows is NOT = to the BottomN 1
If I can get this then I've solved my problem...
Much appreciated.
Kevin
"Jason Carlson [MSFT]" wrote:
> If there is anything special about the row it would be straight forward as a
> chart filter and a table filter to separate the rows. If the only
> distinguishing feature of the row is that it is the last row then I can not
> think of a way in RS 2000 to do this. We are considering allowing
> aggregates of aggregates, which would allow you to filter on the max
> rownumber.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Kevin Wilson" <KevinWilson@.discussions.microsoft.com> wrote in message
> news:A23DB1DA-C4EC-4789-A46A-C236B070F5A4@.microsoft.com...
> > HI,
> > Does anybody know how to write a chart filter that will return only the
> last row in the record set and conversely return all rows except for the
> last in the data set (for a separate chart)
> >
> > My Report consists of a dataset that has the total in the last row. I want
> to create a chart with only the total row and another chart on the same
> page using the same data set but excluding the total row.
> >
> > Cheers
> > Kevin
>
>|||Please see my response to your "NOT BottomN" thread started on 06/29.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kevin Wilson" <KevinWilson@.discussions.microsoft.com> wrote in message
news:A6A1CBD8-F987-472C-B507-E0AA21FD3A4C@.microsoft.com...
> Jason,
> There is nothing special about the row except that it's the last. However
I've managed to created a chart filter that returns the last row by using
the Bottom N operator.
> expression operator value
> =Fields!RH0_Product.Value BottomN =1
> However do you know how to express a filter that defines where the rows
is NOT = to the BottomN 1
> If I can get this then I've solved my problem...
> Much appreciated.
> Kevin
>
> "Jason Carlson [MSFT]" wrote:
> > If there is anything special about the row it would be straight forward
as a
> > chart filter and a table filter to separate the rows. If the only
> > distinguishing feature of the row is that it is the last row then I can
not
> > think of a way in RS 2000 to do this. We are considering allowing
> > aggregates of aggregates, which would allow you to filter on the max
> > rownumber.
> >
> > --
> >
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> >
> >
> > "Kevin Wilson" <KevinWilson@.discussions.microsoft.com> wrote in message
> > news:A23DB1DA-C4EC-4789-A46A-C236B070F5A4@.microsoft.com...
> > > HI,
> > > Does anybody know how to write a chart filter that will return only
the
> > last row in the record set and conversely return all rows except for the
> > last in the data set (for a separate chart)
> > >
> > > My Report consists of a dataset that has the total in the last row. I
want
> > to create a chart with only the total row and another chart on the same
> > page using the same data set but excluding the total row.
> > >
> > > Cheers
> > > Kevin
> >
> >
> >