Saturday, February 25, 2012

can anyone solve this sql query?

hi friends i need help in this sql query

i have table like,

id fid
__ _____
autonumber text

and i am storing values like

id fid
___________________________________
1 1,2,3,4,5

2 11,12,13,14,15

now to find values i am using query

sql = SELECT * FROM test12 WHERE `fid` LIKE ('%1%')

only problem in this query is it is selecting 1 and 11 and i require
only 1 as i am giving one in %1%
now any one have answer of this question then plz plz tell me ......hardik wrote:

Quote:

Originally Posted by

hi friends i need help in this sql query
>
i have table like,
>
id fid
__ _____
autonumber text
>
and i am storing values like
>
id fid
___________________________________
1 1,2,3,4,5
>
2 11,12,13,14,15
>
now to find values i am using query
>
sql = SELECT * FROM test12 WHERE `fid` LIKE ('%1%')
>
only problem in this query is it is selecting 1 and 11 and i require
only 1 as i am giving one in %1%
now any one have answer of this question then plz plz tell me ......


It seems like you are querying a database, that is not even in 1NF - you are
up to your neck in trouble. Rather than working on a single query you should
reorganise your database.

This particular query can be solved by

select *
from test
where fid = '1' -- singleton
or fid like '1,%' -- beginning of line
or fid like '%,1,%' -- middle of line
or fid like '%,1' -- end of line

All of this assuming that you have no spaces in fid.

--
Regards,
Kristian Damm Jensen
"This isn't Jeopardy. Answer below the question."|||Am 16 Oct 2006 00:47:31 -0700 schrieb hardik:

...

Quote:

Originally Posted by

id fid
___________________________________
1 1,2,3,4,5
>
2 11,12,13,14,15
>
now to find values i am using query
>
sql = SELECT * FROM test12 WHERE `fid` LIKE ('%1%')
>
only problem in this query is it is selecting 1 and 11 and i require
only 1 as i am giving one in %1%
now any one have answer of this question then plz plz tell me ......


If ',' is your separator you can use:
SELECT * FROM test12 WHERE `fid` = '1' or `fid` LIKE ('1,%') or
`fid` LIKE ('%,1,%') or `fid` LIKE ('%,1')

bye, Helmut|||Thank you very much!
It works for me perfectly...
Kristian Damm Jensen wrote:

Quote:

Originally Posted by

hardik wrote:

Quote:

Originally Posted by

hi friends i need help in this sql query

i have table like,

id fid
__ _____
autonumber text

and i am storing values like

id fid
___________________________________
1 1,2,3,4,5

2 11,12,13,14,15

now to find values i am using query

sql = SELECT * FROM test12 WHERE `fid` LIKE ('%1%')

only problem in this query is it is selecting 1 and 11 and i require
only 1 as i am giving one in %1%
now any one have answer of this question then plz plz tell me ......


>
It seems like you are querying a database, that is not even in 1NF - you are
up to your neck in trouble. Rather than working on a single query you should
reorganise your database.
>
This particular query can be solved by
>
select *
from test
where fid = '1' -- singleton
or fid like '1,%' -- beginning of line
or fid like '%,1,%' -- middle of line
or fid like '%,1' -- end of line
>
All of this assuming that you have no spaces in fid.
>
--
Regards,
Kristian Damm Jensen
"This isn't Jeopardy. Answer below the question."

|||Kristian Damm Jensen wrote:

Quote:

Originally Posted by

hardik wrote:


Quote:

Originally Posted by

Quote:

Originally Posted by

>hi friends i need help in this sql query
>>
>i have table like,
>>
>id fid
>__ _____
>autonumber text
>>
>and i am storing values like
>>
>id fid
>___________________________________
>1 1,2,3,4,5
>>
>2 11,12,13,14,15
>>
>now to find values i am using query
>>
>sql = SELECT * FROM test12 WHERE `fid` LIKE ('%1%')
>>
>only problem in this query is it is selecting 1 and 11 and i require
>only 1 as i am giving one in %1%
>now any one have answer of this question then plz plz tell me ......


>
It seems like you are querying a database, that is not even in 1NF - you are
up to your neck in trouble. Rather than working on a single query you should
reorganise your database.


http://en.wikipedia.org/wiki/First_normal_form
You shouldn't store multiple values in a single column. Instead, change
your table to look like this:

id fid
-- --
1 1
1 2
1 3
1 4
1 5
2 11
2 12
2 13
2 14
2 15

and then you can simply do

select * from test12 where fid = 1

You should also use column names that are more descriptive than 'id' and
'fid', e.g. 'SalesOrderHeaderID' and 'SalesOrderLineID'.

can anyone show me how to combine these two SQL queries into one

Hello-

i have a fairly big SQL query that is used to display data into a datagrid. Each query grabs data from two seperate databases. Is there anyway to combine these queries into one so all the data appears in 1 datagrid and not 2.

here is the 1st query:

SQL = "SELECT sum(case when month(pb_report_shippers.shipper_date_time) = 1 then pb_report_shippers_lots.quantity else 0 end) as Jan ,sum(case when month(pb_report_shippers.shipper_date_time) = 2 then pb_report_shippers_lots.quantity else 0 end) as Feb ,sum(case when month(pb_report_shippers.shipper_date_time) = 3 then pb_report_shippers_lots.quantity else 0 end) as Mar ,sum(case when month(pb_report_shippers.shipper_date_time) = 4 then pb_report_shippers_lots.quantity else 0 end) as Apr ,sum(case when month(pb_report_shippers.shipper_date_time) = 5 then pb_report_shippers_lots.quantity else 0 end) as May ,sum(case when month(pb_report_shippers.shipper_date_time) = 6 then pb_report_shippers_lots.quantity else 0 end) as Jun ,sum(case when month(pb_report_shippers.shipper_date_time) = 7 then pb_report_shippers_lots.quantity else 0 end) as Jul ,sum(case when month(pb_report_shippers.shipper_date_time) = 8 then pb_report_shippers_lots.quantity else 0 end) as Aug ,sum(case when month(pb_report_shippers.shipper_date_time) = 9 then pb_report_shippers_lots.quantity else 0 end) as Sept ,sum(case when month(pb_report_shippers.shipper_date_time) = 10 then pb_report_shippers_lots.quantity else 0 end) as Oct ,sum(case when month(pb_report_shippers.shipper_date_time) = 11 then pb_report_shippers_lots.quantity else 0 end) as Nov ,sum(case when month(pb_report_shippers.shipper_date_time) = 12 then pb_report_shippers_lots.quantity else 0 end) as Dec FROM pb_customers INNER JOIN pb_jobs ON pb_customers.customer_id = pb_jobs.customer_id INNER JOIN pb_recipes_sub_recipes ON pb_jobs.recipe_id = pb_recipes_sub_recipes.recipe_id INNER JOIN pb_jobs_lots ON pb_jobs.job_id = pb_jobs_lots.job_id INNER JOIN pb_sub_recipes ON pb_recipes_sub_recipes.sub_recipe_id = pb_sub_recipes.sub_recipe_id INNER JOIN pb_report_shippers_lots ON pb_jobs_lots.intrack_lot_id = pb_report_shippers_lots.intrack_lot_id INNER JOIN pb_report_shippers ON pb_report_shippers_lots.job_id = pb_report_shippers.job_id AND pb_report_shippers_lots.shipper_id = pb_report_shippers.shipper_id WHERE pb_customers.customer_deleted <> 1 AND pb_jobs.job_deleted <> 1 AND pb_jobs_lots.lot_deleted <> 1 AND pb_report_shippers.shipper_date_time between cast('01/01/2003 00:01AM' as datetime) and cast('12/31/2003 23:59PM' as datetime)"

Here is the 2nd query:

SQL = "SELECT ISNULL(sum(case when month(nonconformance.nc_date) = 1 then nonconformance.nc_wafer_qty else 0 end),0) as Jan , ISNULL(sum(case when month(nonconformance.nc_date) = 2 then nonconformance.nc_wafer_qty else 0 end),0) as Feb ,ISNULL(sum(case when month(nonconformance.nc_date) = 3 then nonconformance.nc_wafer_qty else 0 end),0) as Mar ,ISNULL(sum(case when month(nonconformance.nc_date) = 4 then nonconformance.nc_wafer_qty else 0 end),0) as Apr , ISNULL(sum(case when month(nonconformance.nc_date) = 5 then nonconformance.nc_wafer_qty else 0 end),0) as May ,ISNULL(sum(case when month(nonconformance.nc_date) = 6 then nonconformance.nc_wafer_qty else 0 end),0) as Jun ,ISNULL(sum(case when month(nonconformance.nc_date) = 7 then nonconformance.nc_wafer_qty else 0 end),0) as Jul ,ISNULL(sum(case when month(nonconformance.nc_date) = 8 then nonconformance.nc_wafer_qty else 0 end),0) as Aug ,ISNULL(sum(case when month(nonconformance.nc_date) = 9 then nonconformance.nc_wafer_qty else 0 end),0) as Sept ,ISNULL(sum(case when month(nonconformance.nc_date) = 10 then nonconformance.nc_wafer_qty else 0 end),0) as Oct ,ISNULL(sum(case when month(nonconformance.nc_date) = 11 then nonconformance.nc_wafer_qty else 0 end),0) as Nov ,ISNULL(sum(case when month(nonconformance.nc_date) = 12 then nonconformance.nc_wafer_qty else 0 end),0) as Dec FROM nonconformance INNER JOIN nc_department on nonconformance.department_id = nc_department.department_id INNER JOIN nc_major_category ON nonconformance.major_category_id = nc_major_category.major_category_id AND nonconformance.status_id <> '5' WHERE nc_department.scrap_category = '1' AND nonconformance.nc_date between cast('01/01/2004 00:01AM' as datetime) and cast('12/31/2004 23:59PM' as datetime)"

I know there has to be someway to combine these into 1. The issue I have is they are in different databases.

ANY HELP would be appreciated.Hi, Andrew,

You may use union query to merge the two sql statements. Make sure they return the same number of columns. If not, add some dummy columns to make them equal(dummy column could be 0 or empty string '')

the issue of diffeent database can be resolved using sytax like
db_name..table_name.
Kind like fully qualified name:)

Take you first query as example: replace 'pb_customers' with 'DatabaseName..pb_customers'.

The query is too big. I am sorry I can't prototype it in my computer. You have to try youself. Let me know if got error message.

Good Luck

-David J.|||thanks figured it out.

Can anyone recommend the best resource for performance tuning a SQL cluster?

I have a couple clusters (each with eight processors total, and 16 GB RAM
total), but am not getting the performance desired. I "inherited" these, I
didn't build them. Can anyone recommend any resources on tuning the cluster
and tuning the SQL service for the best performance?
The Cluster itself has no bearing on performance. You would tune the DB's
just like any other. The only exception is possibly the amount of ram you
use if you have a multi-instance cluster. See here for a start:
http://www.microsoft.com/sql/techinf...perftuning.asp
Performance WP's
http://www.swynk.com/friends/vandenberg/perfmonitor.asp Perfmon counters
http://www.sql-server-performance.co...ance_audit.asp
Hardware Performance CheckList
http://www.sql-server-performance.co...mance_tips.asp
SQL 2000 Performance tuning tips
http://www.support.microsoft.com/?id=q224587 Troubleshooting App
Performance
http://msdn.microsoft.com/library/de...rfmon_24u1.asp
Disk Monitoring
http://www.sql-server-performance.co...showcontig.asp Understanding
DBCC SHOWCONTIG
Andrew J. Kelly SQL MVP
"Adam Freden" <Adam.Freden@.cpsa-rbha.org> wrote in message
news:uUH3lnnmEHA.3356@.TK2MSFTNGP14.phx.gbl...
> I have a couple clusters (each with eight processors total, and 16 GB RAM
> total), but am not getting the performance desired. I "inherited" these,
I
> didn't build them. Can anyone recommend any resources on tuning the
cluster
> and tuning the SQL service for the best performance?
>
|||Just my two cents. Clusters are almost always built on advanced storage
technology (Except for SCSI-based clusters, which are evil). As such, the
performance of the storage device comes into play. If you find the system
is suffering from I/O limitations, you may need to dig into the SAN
performance and tuning to solve your problems. I would start with the links
Andrew sent and only go after SAN tuning once you have found and fixed all
your other performance issues.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:%23jH67KomEHA.3100@.TK2MSFTNGP10.phx.gbl...
> The Cluster itself has no bearing on performance. You would tune the DB's
> just like any other. The only exception is possibly the amount of ram you
> use if you have a multi-instance cluster. See here for a start:
>
> http://www.microsoft.com/sql/techinf...perftuning.asp
> Performance WP's
> http://www.swynk.com/friends/vandenberg/perfmonitor.asp Perfmon counters
> http://www.sql-server-performance.co...ance_audit.asp
> Hardware Performance CheckList
> http://www.sql-server-performance.co...mance_tips.asp
> SQL 2000 Performance tuning tips
> http://www.support.microsoft.com/?id=q224587 Troubleshooting App
> Performance
>
http://msdn.microsoft.com/library/de...rfmon_24u1.asp
> Disk Monitoring
> http://www.sql-server-performance.co...showcontig.asp
Understanding[vbcol=seagreen]
> DBCC SHOWCONTIG
>
> --
> Andrew J. Kelly SQL MVP
>
> "Adam Freden" <Adam.Freden@.cpsa-rbha.org> wrote in message
> news:uUH3lnnmEHA.3356@.TK2MSFTNGP14.phx.gbl...
RAM[vbcol=seagreen]
these,
> I
> cluster
>

Can anyone recommend a super fast Raid 10 Scsi controller for SQL?

I have really had enough of Dell's PERC/3 DC controllers.
Firstly they implement Raid 10 as a span of mirrors rather than a stripe.
Secondly they are just very slow even on a plain stripe.
We paid top dollar for these a couple of years ago but they are really
holding our SQL Server back. We have 24 15k U320 disks and three controllers
and wanted the best, safest solution.
ie Raid 10.
Any controller recommendations?
Thanks
Paul
We used such controlled, moved to EMC/Dell CX300.
"Paul Cahill" wrote:

> I have really had enough of Dell's PERC/3 DC controllers.
> Firstly they implement Raid 10 as a span of mirrors rather than a stripe.
> Secondly they are just very slow even on a plain stripe.
> We paid top dollar for these a couple of years ago but they are really
> holding our SQL Server back. We have 24 15k U320 disks and three controllers
> and wanted the best, safest solution.
> ie Raid 10.
> Any controller recommendations?
> Thanks
> Paul
>
>
|||I'd love to go down this route but it's not a financial option to ditch the
24 scsi drives (and the powervaults).
At this point replacing the Perc3/DCs is the only possibility.
Paul
"andsm" <andsm@.discussions.microsoft.com> wrote in message
news:02EE84E1-7BCF-4801-894C-F02EE7A76B19@.microsoft.com...[vbcol=seagreen]
> We used such controlled, moved to EMC/Dell CX300.
> "Paul Cahill" wrote:
|||Dell has the Perc4's out. They are all based on the Adaptec controller.
With 24 drives, unless you use Fiber, you won't get much faster performance.
SCSI is rather slow over copper.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Paul Cahill" <noname@.anon.com> wrote in message
news:OlE46KzcFHA.584@.TK2MSFTNGP15.phx.gbl...
> I'd love to go down this route but it's not a financial option to ditch
> the 24 scsi drives (and the powervaults).
> At this point replacing the Perc3/DCs is the only possibility.
> Paul
> "andsm" <andsm@.discussions.microsoft.com> wrote in message
> news:02EE84E1-7BCF-4801-894C-F02EE7A76B19@.microsoft.com...
>
|||When we bought the Perc3/dcs we thought 3 dual channel controllers would be
OK. We didn't realise they cannot do true raid 10.
Many of our disks are not being hit as the raid 10 arrays are span of
mirrors not a stripe. I built most of the arrays as a set of four and one
set of six.
eg the log file is on a raid 10 set of 4 18Gb 15k drives but only two lights
flash because the log is smaller than 18gb. If it was a stripe of mirrors
all four lights would flash.
Any idea if the perc4 does true raid 10.
Paul
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:%23HgnHJ1cFHA.612@.TK2MSFTNGP12.phx.gbl...
> Dell has the Perc4's out. They are all based on the Adaptec controller.
> With 24 drives, unless you use Fiber, you won't get much faster
> performance. SCSI is rather slow over copper.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Paul Cahill" <noname@.anon.com> wrote in message
> news:OlE46KzcFHA.584@.TK2MSFTNGP15.phx.gbl...
>

Can anyone recommend a super fast Raid 10 Scsi controller for SQL?

I have really had enough of Dell's PERC/3 DC controllers.
Firstly they implement Raid 10 as a span of mirrors rather than a stripe.
Secondly they are just very slow even on a plain stripe.
We paid top dollar for these a couple of years ago but they are really
holding our SQL Server back. We have 24 15k U320 disks and three controllers
and wanted the best, safest solution.
ie Raid 10.
Any controller recommendations?
Thanks
PaulWe used such controlled, moved to EMC/Dell CX300.
"Paul Cahill" wrote:
> I have really had enough of Dell's PERC/3 DC controllers.
> Firstly they implement Raid 10 as a span of mirrors rather than a stripe.
> Secondly they are just very slow even on a plain stripe.
> We paid top dollar for these a couple of years ago but they are really
> holding our SQL Server back. We have 24 15k U320 disks and three controllers
> and wanted the best, safest solution.
> ie Raid 10.
> Any controller recommendations?
> Thanks
> Paul
>
>|||I'd love to go down this route but it's not a financial option to ditch the
24 scsi drives (and the powervaults).
At this point replacing the Perc3/DCs is the only possibility.
Paul
"andsm" <andsm@.discussions.microsoft.com> wrote in message
news:02EE84E1-7BCF-4801-894C-F02EE7A76B19@.microsoft.com...
> We used such controlled, moved to EMC/Dell CX300.
> "Paul Cahill" wrote:
>> I have really had enough of Dell's PERC/3 DC controllers.
>> Firstly they implement Raid 10 as a span of mirrors rather than a stripe.
>> Secondly they are just very slow even on a plain stripe.
>> We paid top dollar for these a couple of years ago but they are really
>> holding our SQL Server back. We have 24 15k U320 disks and three
>> controllers
>> and wanted the best, safest solution.
>> ie Raid 10.
>> Any controller recommendations?
>> Thanks
>> Paul
>>|||Dell has the Perc4's out. They are all based on the Adaptec controller.
With 24 drives, unless you use Fiber, you won't get much faster performance.
SCSI is rather slow over copper.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Paul Cahill" <noname@.anon.com> wrote in message
news:OlE46KzcFHA.584@.TK2MSFTNGP15.phx.gbl...
> I'd love to go down this route but it's not a financial option to ditch
> the 24 scsi drives (and the powervaults).
> At this point replacing the Perc3/DCs is the only possibility.
> Paul
> "andsm" <andsm@.discussions.microsoft.com> wrote in message
> news:02EE84E1-7BCF-4801-894C-F02EE7A76B19@.microsoft.com...
>> We used such controlled, moved to EMC/Dell CX300.
>> "Paul Cahill" wrote:
>> I have really had enough of Dell's PERC/3 DC controllers.
>> Firstly they implement Raid 10 as a span of mirrors rather than a
>> stripe.
>> Secondly they are just very slow even on a plain stripe.
>> We paid top dollar for these a couple of years ago but they are really
>> holding our SQL Server back. We have 24 15k U320 disks and three
>> controllers
>> and wanted the best, safest solution.
>> ie Raid 10.
>> Any controller recommendations?
>> Thanks
>> Paul
>>
>|||When we bought the Perc3/dcs we thought 3 dual channel controllers would be
OK. We didn't realise they cannot do true raid 10.
Many of our disks are not being hit as the raid 10 arrays are span of
mirrors not a stripe. I built most of the arrays as a set of four and one
set of six.
eg the log file is on a raid 10 set of 4 18Gb 15k drives but only two lights
flash because the log is smaller than 18gb. If it was a stripe of mirrors
all four lights would flash.
Any idea if the perc4 does true raid 10.
Paul
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:%23HgnHJ1cFHA.612@.TK2MSFTNGP12.phx.gbl...
> Dell has the Perc4's out. They are all based on the Adaptec controller.
> With 24 drives, unless you use Fiber, you won't get much faster
> performance. SCSI is rather slow over copper.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Paul Cahill" <noname@.anon.com> wrote in message
> news:OlE46KzcFHA.584@.TK2MSFTNGP15.phx.gbl...
>> I'd love to go down this route but it's not a financial option to ditch
>> the 24 scsi drives (and the powervaults).
>> At this point replacing the Perc3/DCs is the only possibility.
>> Paul
>> "andsm" <andsm@.discussions.microsoft.com> wrote in message
>> news:02EE84E1-7BCF-4801-894C-F02EE7A76B19@.microsoft.com...
>> We used such controlled, moved to EMC/Dell CX300.
>> "Paul Cahill" wrote:
>> I have really had enough of Dell's PERC/3 DC controllers.
>> Firstly they implement Raid 10 as a span of mirrors rather than a
>> stripe.
>> Secondly they are just very slow even on a plain stripe.
>> We paid top dollar for these a couple of years ago but they are really
>> holding our SQL Server back. We have 24 15k U320 disks and three
>> controllers
>> and wanted the best, safest solution.
>> ie Raid 10.
>> Any controller recommendations?
>> Thanks
>> Paul
>>
>>
>

Can anyone recommend a super fast Raid 10 Scsi controller for SQL?

I have really had enough of Dell's PERC/3 DC controllers.
Firstly they implement Raid 10 as a span of mirrors rather than a stripe.
Secondly they are just very slow even on a plain stripe.
We paid top dollar for these a couple of years ago but they are really
holding our SQL Server back. We have 24 15k U320 disks and three controllers
and wanted the best, safest solution.
ie Raid 10.
Any controller recommendations?
Thanks
PaulWe used such controlled, moved to EMC/Dell CX300.
"Paul Cahill" wrote:

> I have really had enough of Dell's PERC/3 DC controllers.
> Firstly they implement Raid 10 as a span of mirrors rather than a stripe.
> Secondly they are just very slow even on a plain stripe.
> We paid top dollar for these a couple of years ago but they are really
> holding our SQL Server back. We have 24 15k U320 disks and three controlle
rs
> and wanted the best, safest solution.
> ie Raid 10.
> Any controller recommendations?
> Thanks
> Paul
>
>|||I'd love to go down this route but it's not a financial option to ditch the
24 scsi drives (and the powervaults).
At this point replacing the Perc3/DCs is the only possibility.
Paul
"andsm" <andsm@.discussions.microsoft.com> wrote in message
news:02EE84E1-7BCF-4801-894C-F02EE7A76B19@.microsoft.com...[vbcol=seagreen]
> We used such controlled, moved to EMC/Dell CX300.
> "Paul Cahill" wrote:
>|||Dell has the Perc4's out. They are all based on the Adaptec controller.
With 24 drives, unless you use Fiber, you won't get much faster performance.
SCSI is rather slow over copper.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Paul Cahill" <noname@.anon.com> wrote in message
news:OlE46KzcFHA.584@.TK2MSFTNGP15.phx.gbl...
> I'd love to go down this route but it's not a financial option to ditch
> the 24 scsi drives (and the powervaults).
> At this point replacing the Perc3/DCs is the only possibility.
> Paul
> "andsm" <andsm@.discussions.microsoft.com> wrote in message
> news:02EE84E1-7BCF-4801-894C-F02EE7A76B19@.microsoft.com...
>|||When we bought the Perc3/dcs we thought 3 dual channel controllers would be
OK. We didn't realise they cannot do true raid 10.
Many of our disks are not being hit as the raid 10 arrays are span of
mirrors not a stripe. I built most of the arrays as a set of four and one
set of six.
eg the log file is on a raid 10 set of 4 18Gb 15k drives but only two lights
flash because the log is smaller than 18gb. If it was a stripe of mirrors
all four lights would flash.
Any idea if the perc4 does true raid 10.
Paul
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:%23HgnHJ1cFHA.612@.TK2MSFTNGP12.phx.gbl...
> Dell has the Perc4's out. They are all based on the Adaptec controller.
> With 24 drives, unless you use Fiber, you won't get much faster
> performance. SCSI is rather slow over copper.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Paul Cahill" <noname@.anon.com> wrote in message
> news:OlE46KzcFHA.584@.TK2MSFTNGP15.phx.gbl...
>

Can anyone really disable caching?

For report properties, I am in 'Execution' and the settings is at 'Do not
cache'. I'd expect this to totally stop caching!
What I'm looking for is the report to pull back fresh data every time it's
requested, NOT when a parameter has to be changed first.
I saw a solution where developers where putting hidden fields on their
reports where these are populated by data that will change every time a
report is requested. If this is the only solution then I understand
completely why this has to happen, but it's still completely hideous. Any
ideas?If the report is set to live you should always get back fresh data, unless
you are doing drill downs. Are you saying if you open two browsers and
browse at separate times they will get cached data?
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Matt Swift" <MattSwift@.discussions.microsoft.com> wrote in message
news:7E9D7F4B-503D-4056-B2D2-B9D238AD7910@.microsoft.com...
> For report properties, I am in 'Execution' and the settings is at 'Do not
> cache'. I'd expect this to totally stop caching!
> What I'm looking for is the report to pull back fresh data every time it's
> requested, NOT when a parameter has to be changed first.
> I saw a solution where developers where putting hidden fields on their
> reports where these are populated by data that will change every time a
> report is requested. If this is the only solution then I understand
> completely why this has to happen, but it's still completely hideous.
> Any
> ideas?

Can anyone plss help me with this sql syntax plss...

Hi.. I want to join this query
[CODE]select Count(*) from iCalls_Events where Call_ID = " & Session("Call_ID") & "select Count(*) from iCalls_Events where Call_ID = "& Session("Call_ID") & " and Events_Flag <> 0[/CODE]
in this query
[CODE]select iCalls_Calls.Call_ID,iCalls_Calls.Requestor,Type,Scope,iCalls_Calls.Status_ID,iCalls_Status.Status_ID,iCalls_Status.Status_Label from ((iCalls_Calls inner join iCalls_Status on iCalls_Calls.Status_ID=iCalls_Status.Status_ID ) inner join iCalls_Users on iCalls_Calls.Requestor=iCalls_Users.User_ID) left outer join iCalls_Messages on iCalls_Calls.Call_ID=iCalls_Messages.Call_ID where Requestor='" & Session("User_ID") & "' AND iCalls_Calls.Status_ID <> 6 order by iCalls_Calls.Call_ID[/CODE]
The Place where i need to Join is after
[CODE]iCalls_Status.Status_ID,iCalls_Status.Status_Label [/CODE]
and before
[CODE]((iCalls_Calls inner join iCalls_Status on iCalls_Calls.Status_ID=iCalls_Status.Status_ID )[/CODE]
I want to add ( / ) in between these 2 queries. The reason is for example first query will return '5' and second '10' , so the output i need is 5 / 10. And i need to put this query in a variable (Countrec) (as i need to bind Countrec to a repeater list ) like
[CODE]select Count(*) from iCalls_Events where Call_ID = " & Session("Call_ID") & " ( / )select Count(*) from iCalls_Events where Call_ID = "& Session("Call_ID") & " and Events_Flag <> 0 as Countrec[/CODE] . I HAVE TO BIND THIS "Countrec" in the repeater list.The Final Query would be something like this
[CODE]select iCalls_Calls.Call_ID,iCalls_Calls.Requestor,Type,Scope,iCalls_Calls.Status_ID,iCalls_Status.Status_ID,iCalls_Status.Status_Label, select Count(*) from iCalls_Events where Call_ID = " & Session("Call_ID") & " ( / )select Count(*) from iCalls_Events where Call_ID = "& Session("Call_ID") & " and Events_Flag <> 0 as Countrec from ((iCalls_Calls inner join iCalls_Status on iCalls_Calls.Status_ID=iCalls_Status.Status_ID ) inner join iCalls_Users on iCalls_Calls.Requestor=iCalls_Users.User_ID) left outer join iCalls_Messages on iCalls_Calls.Call_ID=iCalls_Messages.Call_ID where Requestor='" & Session("User_ID") & "' AND iCalls_Calls.Status_ID <> 6 order by iCalls_Calls.Call_ID[/CODE]
but this syntax is not correct..Please can U get me the Correct Syntax.

Moving to Transact-SQL, as it seems the ideal place to post this question.

Thanks,

John

|||

You need to understand a thing or two about formatting your code. People will take time out of thier busy lives to extend help for free without anticiapting anything, but you need to follow certain etiquettes, like posting your question clearly, formatting the code so that it is easy to read and interpret. Ok, enough of that. Now lets look into the problem.

Code Snippet

--select 1

select

Count(*)

from

iCalls_Events

where Call_ID = " & Session("Call_ID") & "

--select 2

select

Count(*)

from

iCalls_Events

where Call_ID = "& Session("Call_ID") & " and Events_Flag <> 0

--select 3

select

iCalls_Calls.Call_ID

, iCalls_Calls.Requestor

, Type

, Scope

, iCalls_Calls.Status_ID

, iCalls_Status.Status_ID

, iCalls_Status.Status_Label

from

iCalls_Calls inner join iCalls_Status

on iCalls_Calls.Status_ID=iCalls_Status.Status_ID

inner join iCalls_Users

on iCalls_Calls.Requestor=iCalls_Users.User_ID)

left outer join iCalls_Messages

on iCalls_Calls.Call_ID=iCalls_Messages.Call_ID

where Requestor='" & Session("User_ID") & "'

AND iCalls_Calls.Status_ID <> 6

order by iCalls_Calls.Call_ID

You want to get the count of select 1 / select 2 and capture the value of this in select 3 along with other columns right, if I understand your question correctly. Then this should work for you. test it out for yourself.

select

iCalls_Calls.Call_ID

, iCalls_Calls.Requestor

, Type

, Scope

, iCalls_Calls.Status_ID

, iCalls_Status.Status_ID

, iCalls_Status.Status_Label

, ( select Count(*) from iCalls_Events where Call_ID = " & Session ("Call_ID") & ") /

( select Count(*) from iCalls_Events where Call_ID = "& Session("Call_ID") & " and Events_Flag <> 0)

from

iCalls_Calls inner join iCalls_Status

on iCalls_Calls.Status_ID=iCalls_Status.Status_ID

inner join iCalls_Users

on iCalls_Calls.Requestor=iCalls_Users.User_ID)

left outer join iCalls_Messages

on iCalls_Calls.Call_ID=iCalls_Messages.Call_ID

where Requestor='" & Session("User_ID") & "'

AND iCalls_Calls.Status_ID <> 6

order by iCalls_Calls.Call_ID

Also you should be able to do a small simple test before doing this a big query. Its easy when you break down the task into smaller ones.

create table test_a (col1a int, col2a int)

create table test_b (col1b int, col2b int)

create table test_c (col1c int, col2c int)

insert test_a select 1, 2

insert test_a select 1, 2

insert test_b select 2, 3

insert test_c select 3, 4

select

col1c

, col2c

, ((select count(1) from test_a) / (select count(1) from test_b)) as rec_count

from test_c

CAN ANYONE PLS HELP ME ON THIS--REGARDING SQL SERVER installation....VERY URGENT

I have downloaded the sql server 2005 express edition from the MSDN...but i cant figure out how to create the database there....no database engine is shown where I can proceed.Only Configuration tool is shown...how do i go about it...pls tell me asap.thanks

If you've installed the database engine (check config tool or services) your next step may be to download the SQL Server Management Studio Express which is the GUI for managing express databases. This doesn't come out the box (unless you chose the edition with advanced services).

HTH!

|||

Could you tell me that ...in order to work on VB.NET,ASP.NET,SQL SERVER 2000......to create web application.....which software to download from the internet free of cost so that I can work on it for practice.....

|||you can download Mnagment Studio from this link
http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&DisplayLang=en|||

Check out the Visual Studio express editions.

http://msdn2.microsoft.com/en-gb/express/default.aspx

Can anyone please tell me what is wrong with this query

Can anyone please tell me what is wrong with this query:

rsOtherSubCatagories.Source = "SELECT * FROM SubCatagories WHERE SubCatagoryID = " + Replace(rsSubCatagories__MMColParam, "'", "''") AND CatagoryID = " + Replace(rsOtherSubCatagories__MMColParam, "'", "''")

In DreamWeaver the bit in bold is greyed out, why?

rsOtherSubCatagories.Source = "SELECT * FROM SubCatagories WHERE SubCatagoryID = " + Replace(rsSubCatagories__MMColParam, "'", "''") AND CatagoryID = " + Replace(rsOtherSubCatagories__MMColParam, "'", "''")

Thanks Joe

Hey Joe,

you're missing some( + " ), try this:

rsOtherSubCatagories.Source = "SELECT * FROM SubCatagories WHERE SubCatagoryID = " + Replace(rsSubCatagories__MMColParam, "'", "''") + " AND CatagoryID = " + Replace(rsOtherSubCatagories__MMColParam, "'", "''")

|||

Hikpeguero,

thanks very much for answering, that has stopped the error message but it isnt actually working though...

Im trying to test and see if the current record set is a subcategory in the database, the record im testing is, but it isnt being picked up as one.

This is the basic structure of the table "SubCatagories" im running the query on:

|SubCatagoryID|CatagoryID|"CatagoryName"|
|241|0|"Cat Types"|
|242|0|"Dog Types"|
|243|0|"Fish Types"|
|244|0|"Insect Types"|
|427|243|"Anglers"|
|428|243|"Anthias"|
|429|243|"Basslets"|

The values im trying to check above equate to the query string passed in the URL: page.asp?SubcatagoryID=428

If the current Query string is "428" (Anglers) then it is a subcategory of "243" (Fish Types) as the code loops through the records I need it to check if the query string "428" is associated with the SubCategoryID record being loped through at the time. It should check the Request.QueryString("SubCatagoryID") against the CategoryID of the other records for a match, When it gets to "243" (Fish Types) for example it should find that the current QueryString("SubcatagoryID") of 428 maches, because the CatagoryID in that record matches the (Fish Types) SubCatagoryID.

rsSubCatagories__MMColParam = 428 and rsOtherSubCatagories__MMColParam = 243 Thus the query:

rsOtherSubCatagories.Source = "SELECT * FROM SubCatagories WHERE SubCatagoryID = " + Replace(rsSubCatagories__MMColParam, "'", "''") + " AND CatagoryID = " + Replace(rsOtherSubCatagories__MMColParam, "'", "''")

What is the best way to test for this, should I open a new database connection and run a query for each record? And if so how would I construct the query to check this?

Thanks for your help, Joe

Can anyone offer me any suggestions on how to create a back up site w/ db in the

I am currently running a site on a shared environment with sql db. The account is with verio.com: Windows Server 2003m SQL 2000.

What we would like to do is create a back up site with a backup db. I would like this functionality so that in the event of a crash, while the current site is being repaired, or if the server is down for a prolonged period, I can simply switch to the backup site w/ db.

What would the preferable method of doing this in such an environment? Any help would be greatly appreciated. Thanks.Look into Log Shipping, sounds like it may answer your needs.|||I just read up on that at:

http://www.sql-server-performance.com/sql_server_log_shipping.asp

Very interesting...however can I pull that off in a shared environment, even if I have to get a second account?|||I don't see any issue with LS working in shared environment.
Can you explain about second account?|||Originally posted by rdjabarov
Look into Log Shipping, sounds like it may answer your needs.

Can anyone make a suggestion?

the "View Report" button - Can it be place at a fixed position so that
the user sees to press it instead of having to scroll to the right?
ThanksYou can open a window using javascript and play with window's size. The
toolbar controls will wrap.
Just a suggestion.
"Hoa" <hn.hoanguyen@.gmail.com> wrote in message
news:1128089846.201541.180790@.g14g2000cwa.googlegroups.com...
> the "View Report" button - Can it be place at a fixed position so that
> the user sees to press it instead of having to scroll to the right?
> Thanks
>|||Thank you, Oleg. I will give it a try.

can anyone help?

okay i have installed sql 2000 server dev and iis6.0 and i wrote a aspscript to connect to my database through the odbc dsn that i made andwhen i run the script it says this:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
/connect.asp, line 14
and here is the code that generated this:
<%@. Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<!--StartFragment -->
<%
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DSN=mssql"
If conn.errors.count = 0 Then
Response.write "Connected OK"
End If
%>
<P> </P>
</BODY>
</HTML>
could anyone help me or know what might be wrong?

You are not providing a user name. Search how to include a username for that connection. You prob just need to add the default username like 'admin' .|||well i have mysql to and when i type its dsn in it works??.....do i need to include it in the code you mean?
|||Is you username and password specified in the DSN?
Have you tried:
Conn.Open "DSN=NameofDSN;Uid=Username;Pwd=Password"

Can anyone help with with datatype float

I have some engineering data in my table and the db designer is representing it with a float datatype. Here's what is happening. If I query on a record based on id num and get a row and put it in text boxes in my Windows App, min_riv_hd_dia (the float) is 0.026<14 zeroes>2. If I try to query and get that same record again but this time based on id num and min_riv_hd_dia equal to 0.026<14 zeroes>2, I get no row found. If I just do a select on this row based on id number, sql server displays it as 0.026. But if I query with 0.026 as my value, still the row is not found. If I query min_riv_hd_dia > 0.026, the record is found.

So my question is, how can I tell the exact value that must be input in my search criteria in order to find this row?

Thank you so much if you can help!well, you have discovered that float is not a percise data type and is only appropriate for some scientific and engineering calculations. Switch to decimal with the correct percision or scale or do not search on the float field.|||So my question is, how can I tell the exact value that must be input in my search criteria in order to find this row?That's the crux of it - it is not an exact value.

A couple of interesting links:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=71391
http://docs.sun.com/source/806-3568/ncg_goldberg.html|||Thank you both.

I like Thrasymachus' suggestion...do not search on the float field.|||If you have to compare floating-point values. Check that the difference between them is small compared to the size of the numbers, rather than look for exact equality (i.e. use rounding).

where round(min_riv_hd_dia,10)=0.026

float is an approximate numeric datatype and should not be used where absolute precision is required. This type is useful for applications that need large numbers but do not need precise accuracy. If you require very accurate numbers, use the decimal data type (e.g. in financial applications).

For more info see
What Every Computer Scientist Should Know About Floating-Point Arithmetic (http://docs.sun.com/source/806-3568/ncg_goldberg.html)

Also interesting to note is that floating point arithmetic is used in excel and many combinations of arithmetic operations may produce results that appear to be incorrect by very small amounts.
see http://support.microsoft.com/kb/214118/

Can anyone help with waittype 0x0044?

Hi,

I wonder if anyone can shed any light on the following as i just can't
explain it.

A user is running an update on a 500m+ row table setting a column
value, computing its value from another column in the table. It's now
been running for 23hours.

The server is Itanium 64, enterprise 2005, SAN based storage and it
usually handles anything with this volume quite quickly, probably
about 30 mins or so.

There is nothing else running currently although overnight batches,
backups etc have been running within the last 23 hours.

In sysprocess it showing the following :-

spid kpid blocked waittype waittime
lastwaittype waitresource
52 5236 0 0x0044 30
PAGEIOLATCH_EX 6:13:1754732

the process seems to stay in this waittype for a few secnds and then
goes to a 0x0000 and then back into this one again. I can see from the
IO counter that IO is increasing and also looking at the current IO i
see the following so presume the query is still working :-

select
database_id,
file_id,
io_stall,
io_pending_ms_ticks,
scheduler_address
from sys.dm_io_virtual_file_stats(NULL, NULL)t1,
sys.dm_io_pending_io_requests as t2
where t1.file_handle = t2.io_handle

gives results :-

613151115052100x0000000008624080

I just can't explain why it is so slow when nothing else is ruuning.

Anyone have any ideas on what i can check on?

Thanks

Ian.ianwr (ianwrigglesworth@.yahoo.co.uk) writes:

Quote:

Originally Posted by

A user is running an update on a 500m+ row table setting a column
value, computing its value from another column in the table. It's now
been running for 23hours.


Would the update cause the rows to grow? For instance, if this is
a new column that was added as nullable, and is now being populated?
In that case the table will need to grow, and could take some time.
Not the least if the data file has to grow as well.

Quote:

Originally Posted by

There is nothing else running currently although overnight batches,
backups etc have been running within the last 23 hours.
>
In sysprocess it showing the following :-
>
spid kpid blocked waittype waittime
lastwaittype waitresource
52 5236 0 0x0044 30
PAGEIOLATCH_EX 6:13:1754732


In sys.dm_exec_requests there is a wait_type which is likely to be
more informative than 0x0044.

Quote:

Originally Posted by

Anyone have any ideas on what i can check on?


Obviously a

SELECT COUNT(*) FROM tbl (NOLOCK) WHERE col <expected value

will you some progress information.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Hi Erland,

Thanks for the view to use, unfortunately when i arrived this morning
the task had stopped and took about 29 hours to run.

Going to keep an eye on things and check out the san as well today,
Thanks for the info anyway, if it happens again i'll repost

Thanks

Ian,

can anyone help with this update statement?

I am wondering how to write a sql update statement that would:


Update table 1
set col 2 = 'YES'
where (select col 1 from table 1 where col 2 = 'YES')


Table 1 BEFORE:
Col 1 Col 2
A
A
A
B
B YES
B
C
C
C
D
D YES
D

Table 1 After:
Col 1 Col 2
A
A
A
B YES
B YES
B YES
C
C
C
D YES
D YES
D YES

Can anyone give me some ideas how to write this statement or point me in the right direction?

Thanks,

Blair

Try something along the lines of:

Code Snippet

Update [table 1]
set [col 2] = 'YES'
from [table 1] a -- "a" is an alias
where exists
( select [col 1]
from [table 1] b -- "b" is an alias
where b.[col 2] = 'YES'
and a.[col 1] = b.[col 1]
)

|||

Here is one way.

Code Snippet

update table1

set col2=t.col2

from table1 join (select * from table1 where col2='YES') [t] on table1.col1=t2.col1

|||

While the queries given will fix this data, and you could correct the problem somewhat by embedding those queries in a trigger, this is a classic sign of a poorly normalized table. If one value in the row, in this case Col 2, is determined by the value in another column Col1, then you have the high potential for data problems. (Which clearly you do, since you are writing this query.)

You should definitely consider having a table that represents whatever Table1 represents where Col1 is the key, and the Col2 values is its column. Then, one modification takes care of everything, and you don't end up with inconsistent data.

|||

The simplest syntax:

Code Snippet

Update Table1

Set Col2 = 'Yes'

where Col1 in (Select Col1 from Table1 where Col2 = 'Yes')

|||

This worked perfectly.

Thanks,

Blair

Can anyone help with this query?

Cant work out the following:

Say i have a table 'P_STABILITY_PROTOCOL' that has the following data:

REC_ID ** LAST_AUTHORISED_VERSION_I ** LINKED_PSP_ID_I

1 1 83
2 2 83
3 3 83
4 1 108
5 1 114
6 2 114

I need the max LAST_AUTHORISED_VERSION_I value for each LINKED_PSP_ID_I group so i'm using the following query which returns part of what i need:

*********************************************************************************************************************************

SELECT MAX(LAST_AUTHORISED_VERSION_I) AS LAST_AUTHORISED_VERSION_I,LINKED_PSP_ID_I FROM(

SELECT

P_STABILITY_PROTOCOL.*,

R_PROTOCOL_TYPE.DESCRIPTION_T AS PROTOCOL_TYPE_T,

Z_STATUS.DESCRIPTION_T AS STATUS_T

FROM P_STABILITY_PROTOCOL, Z_STATUS, R_PROTOCOL_TYPE

WHERE (P_STABILITY_PROTOCOL.ZS_ID_I = Z_STATUS.ZS_ID_I)

AND (P_STABILITY_PROTOCOL.RPT_ID_I = R_PROTOCOL_TYPE.RPT_ID_I)

AND (P_STABILITY_PROTOCOL.SSMP_ID_I = 37)

AND (P_STABILITY_PROTOCOL.RETIRED_FLAG_T = 'N')

AND (Z_STATUS.DESCRIPTION_T = 'Approved')

ORDER BY LINKED_PSP_ID_I, LAST_AUTHORISED_VERSION_I)

GROUP BY LINKED_PSP_ID_I

*********************************************************************************************************************************

This returns the correct values of:

LAST_AUTHORISED_VERSION_I ** LINKED_PSP_ID_I

3 83
1 108
2 114

This is i need the REC_ID value (and others) returning as well but obviously if i add it to the SELECT bit of the original query then the 'Group by' will all go to *** and it'll just return every value in the DB not just the highest authorised value for the group. Anyone know how i do this? Could i use a cursor and loop through the table? Tried using self joins but just cannot get it to return the same values as the original query. That LAST_AUTHORISED_VERSION_I and LINKED_PSP_ID_I value combined will always be particular to a single distinct record if thats any help?

Cheers.

Check if this gives you a direction:

Declare @.ttable (recidint, versionidint, pspidint)insert into @.tselect 1 , 1 , 83unionallselect 2 , 2 , 83unionallselect 3 , 3 , 83unionallselect 4 , 1 , 108unionallselect 5 , 1 , 114unionallselect 6 , 2 , 114select T1.recid, T2.MAxVerId, T1.pspidfrom @.t T1Join (Select max(versionid)as MAxVerId, pspidfrom @.tgroup by pspid) T2on T1.versionid = T2.MAxVerIdand T1.pspid = T2.pspidOrder by recid

Can anyone help with this query...

Hi,I'm moving across to SQL Server after using MySQL and having trouble with one particular query. My tables are outlined below. I'm trying to get hold of the names of bands playing the most recently added shows but can't quite get there.


Shows table = Id.. some other columns.. DateAdded
Bands table = Id, Name
Playing table = Id, Show_Id, Band_Id

My query at the moment is

SELECT Bands.Name FROM Shows
INNER JOIN Playing ON Shows.Id = Playing.Show_Id
INNER JOIN Bands ON Bands.Id = Playing.Band_Id
AND Playing.Headlining = 1
ORDER BY Shows.DateAdded DESC

Which gives me the right results but will return duplicate band names if there is more than one new show for that band. I've tried doing SELECT DISTINCT Bands.Name but get an error saying "ORDER BY items must appear in the select list if SELECT DISTINCT is specified". I also tried using a GROUP BY clause but I can't seem to combine it with the order by clause without getting an error.

I've tried creating a view which handles the joining and selecting distinct Names from the view but this is ignoring the ordering and just returns band names in alphabetical order.

I hope you understand my problem and I really HOPE someone has a solution even if it means returning some extra columns which I can just ignore in my page logic. Thanks.

SELECT Bands.Name, MAX(Shows.DateAdded) FROM Shows
INNER JOIN Playing ON Shows.Id = Playing.Show_Id
INNER JOIN Bands ON Bands.Id = Playing.Band_Id
AND Playing.Headlining = 1

GROUP BY Bands.Name
ORDER BY Shows.DateAdded DESC

|||

Thanks for the reply but that doesn't work either. The error I get the same I error I was getting when I tried using GROUP BY...

Msg 8127, Level 16, State 1, Line 1

Column "Shows.DateAdded" is invalid in the ORDER BY clause because it is not contained in either an aggregate function or the GROUP BY clause.

|||

You could try a slight variation of that:

SELECT Bands.Name, MAX(Shows.DateAdded) FROM Shows
INNER JOIN Playing ON Shows.Id = Playing.Show_Id
INNER JOIN Bands ON Bands.Id = Playing.Band_Id
AND Playing.Headlining = 1

GROUP BY Bands.Name
ORDER BY 2 DESC

or

SELECT Bands.Name, MAX(Shows.DateAdded) FROM Shows
INNER JOIN Playing ON Shows.Id = Playing.Show_Id
INNER JOIN Bands ON Bands.Id = Playing.Band_Id
AND Playing.Headlining = 1

GROUP BY Bands.Name
ORDER BY MAX(Shows.DateAdded) DESC

|||They both work. Thank you.

Can anyone help with help?

I guess I shouldn't expect Microsoft to go to any trouble to make our lives easier but my goodness they've out done themselves with the latest help system.

Can anyone tell me how to actually find help on anything? I open SQL Server Managment studio and click help How do I and get help on how to use help... Boy how useful... Next I click on search and tell it to search for Autoinc, or increment, and tell it to search products for SQL Server. Boy how nice to bring me all these useful topics on articles written on Fox Pro in the late 90's...

In fact, not a single help entry on SQL Server anywhere in my list... Great!

This is normal. Every search I've done I've had to resort to google. I've even tried turning off this feature to go to the Internet for all the help and its still useless.

All I started out wanting was to find out how to create an AutoInc field type or at least provide that type of feature with SQL Server and 30 minutes later I find myself complaining about help on help!

Is anyone finding this help system with Visual Studio 2005 and SQL Server 2005 even remotely helpful? They should rename it the ConfuseQLater or something...

what i understand from this is u have not installed Books Online (BOL) which is the bible for SQL Server... While installing you should have opted this option ...

download and install BOL from this link...

http://www.microsoft.com/downloads/details.aspx?familyid=a6f79cb1-a420-445f-8a4b-bd77a7da194b&displaylang=en

Madhu

Can Anyone help us

Hi,
I encounter a problem when setting a subscription in rs(with sp2)
:
Failure sending mail: The server rejected the sender address. The
server response was: 503 Authentication needed for local user.
this is my configuration in rsreportserver.config:
<Configuration>
<RSEmailDPConfiguration>
<SMTPServer>mail.gillion.com.cn</SMTPServer>
<SMTPServerPort>25</SMTPServerPort>
<SMTPAccountName></SMTPAccountName>
<SMTPConnectionTimeout></SMTPConnectionTimeout>
<SMTPServerPickupDirectory></SMTPServerPickupDirectory>
<SMTPUseSSL></SMTPUseSSL>
<SendUsing></SendUsing>
<SMTPAuthenticate>0</SMTPAuthenticate>
<From>houlh@.gillion.com.cn</From>
<EmbeddedRenderFormats>
<RenderingExtension>MHTML</RenderingExtension>
</EmbeddedRenderFormats>
<PrivilegedUserRenderFormats></PrivilegedUserRenderFormats>
<ExcludedRenderFormats>
<RenderingExtension>HTMLOWC</RenderingExtension>
<RenderingExtension>NULL</RenderingExtension>
</ExcludedRenderFormats>
<SendEmailToUserAlias>True</SendEmailToUserAlias>
<DefaultHostName></DefaultHostName>
<PermittedHosts></PermittedHosts>
</RSEmailDPConfiguration>
</Configuration>
IS anythig wrong?
thx a lot!It sounds like your SMTP server requires authentication. RS only support
anonymous and NTLM authentication. If you server uses NTLM then you need to
make sure the user that the ReportServer service runs under has permission
to send mail. If you server requires basic auth then you can use the local
SMTP server to relay the messages. Set the SMTPServerPickupDirectory to the
local SMTP's pickup directory and the SendUsing element to 1. Then
configure the local SMTP server to relay the messages.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"weiyf" <weiyf@.gillion.com.cn> wrote in message
news:%23oQUFspYFHA.3356@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I encounter a problem when setting a subscription in rs(with sp2)
> :
> Failure sending mail: The server rejected the sender address. The
> server response was: 503 Authentication needed for local user.
> this is my configuration in rsreportserver.config:
> <Configuration>
> <RSEmailDPConfiguration>
> <SMTPServer>mail.gillion.com.cn</SMTPServer>
> <SMTPServerPort>25</SMTPServerPort>
> <SMTPAccountName></SMTPAccountName>
> <SMTPConnectionTimeout></SMTPConnectionTimeout>
> <SMTPServerPickupDirectory></SMTPServerPickupDirectory>
> <SMTPUseSSL></SMTPUseSSL>
> <SendUsing></SendUsing>
> <SMTPAuthenticate>0</SMTPAuthenticate>
> <From>houlh@.gillion.com.cn</From>
> <EmbeddedRenderFormats>
> <RenderingExtension>MHTML</RenderingExtension>
> </EmbeddedRenderFormats>
> <PrivilegedUserRenderFormats></PrivilegedUserRenderFormats>
> <ExcludedRenderFormats>
> <RenderingExtension>HTMLOWC</RenderingExtension>
> <RenderingExtension>NULL</RenderingExtension>
> </ExcludedRenderFormats>
> <SendEmailToUserAlias>True</SendEmailToUserAlias>
> <DefaultHostName></DefaultHostName>
> <PermittedHosts></PermittedHosts>
> </RSEmailDPConfiguration>
> </Configuration>
> IS anythig wrong?
> thx a lot!
>

Can anyone help solve this puzzle?

I have one SQL instance that is giving me problems: everytime I restore a
database to it, the database has many consistency errors.
I have 3 servers I can test with: Server A, Server B, and Server C. Server
C is the one that's giving me problems.
I run a DBCC CheckDB on a database on Server A, then back it up. If I then
try to restore that backup on Server C, the backup works but DBCC CheckDB
reveals numerous errors. However, I can take that same backup file and
restore it on Server B, and everything is fine.
I can spend lots of time with my corrupt database on Server C and using DBCC
CheckDB (repair_rebuild or repair_allow_data_loss) and dbreindex to finally
get the database to report that it has no consitency errors. HOWEVER, if I
then try to back up that database and restore it on either Server A or
Server B, the restore works ok, but the database again is full of
consistency errors. Restore/backup works with no problems whatsoever
between Server A and Server B.
All of these problems apply not only to backup/restore, but also if I try to
just detach from Server A (or B) and attach to Server C.
I have sees several errors in the SQL log, on Server C, 604 (and some
others). I wish I had the complete list but I have re-installed SQL and
lost the logs.
I thought maybe it was an problem with the install, but as I just mentioned,
I completely re-installed on Server C, but the problems continue. To this
point in the current logs, there are no errors.
At this point I am thinking hardware, but the network guys insist that it
has passed all tests. Next I am going to run SQLIOStress (
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q231/6/19.asp&NoWebContent=1 )
and see if that turns anything up.
Oh, info on the servers:
Server A: SQL: 8.00.194 RTM Enterprise Edition OS: Windows 2000
(Build 2195 SP3)
Server B: SQL: 8.00.760 SP3 Developer Edition OS: Windows Server 2003
Standard Edition (Build 3790.srv03_rtm.030324-2048)
Server C: SQL: 8.00.760 SP3 Enterprise Edition OS: Windows 2000
(Build 2195 SP4) NOTE: the new install has no SQL service packs applied, no
difference in behavior
Any help/suggestions/links would be greatly appreciated. Please post back
here so that maybe any other unlucky soul that has this problem can benefit
from the smart folks out there.
thanks,
Greg
gjleclair AT hotmail DOT comGreg,
Step 1: install SQL Server service pack 3a and Win2K service pack 4 on
server A.
Step 2: see if you are still having trouble.
I wouldn't be so sure it's server C with the problem. Server A, which
has no SQL Server service packs installed, created the backup.
You mentioned briefly a problem detaching from B and attaching to C. If
that is a problem that is reproducible from scratch without any contact
with Server A, post the details of what's going on with that.
There are hardware issues that can cause this kind of problem that might
not be called hardware problems, such as the one described in
http://support.microsoft.com:80/support/kb/articles/q268/4/81.asp, but I
doubt you'll get much help asking why things aren't working on an
non-updated server.
SK
Greg wrote:
>I have one SQL instance that is giving me problems: everytime I restore a
>database to it, the database has many consistency errors.
>I have 3 servers I can test with: Server A, Server B, and Server C. Server
>C is the one that's giving me problems.
>I run a DBCC CheckDB on a database on Server A, then back it up. If I then
>try to restore that backup on Server C, the backup works but DBCC CheckDB
>reveals numerous errors. However, I can take that same backup file and
>restore it on Server B, and everything is fine.
>I can spend lots of time with my corrupt database on Server C and using DBCC
>CheckDB (repair_rebuild or repair_allow_data_loss) and dbreindex to finally
>get the database to report that it has no consitency errors. HOWEVER, if I
>then try to back up that database and restore it on either Server A or
>Server B, the restore works ok, but the database again is full of
>consistency errors. Restore/backup works with no problems whatsoever
>between Server A and Server B.
>All of these problems apply not only to backup/restore, but also if I try to
>just detach from Server A (or B) and attach to Server C.
>I have sees several errors in the SQL log, on Server C, 604 (and some
>others). I wish I had the complete list but I have re-installed SQL and
>lost the logs.
>I thought maybe it was an problem with the install, but as I just mentioned,
>I completely re-installed on Server C, but the problems continue. To this
>point in the current logs, there are no errors.
>At this point I am thinking hardware, but the network guys insist that it
>has passed all tests. Next I am going to run SQLIOStress (
>http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q231/6/19.asp&NoWebContent=1 )
>and see if that turns anything up.
>
>Oh, info on the servers:
>Server A: SQL: 8.00.194 RTM Enterprise Edition OS: Windows 2000
>(Build 2195 SP3)
>Server B: SQL: 8.00.760 SP3 Developer Edition OS: Windows Server 2003
>Standard Edition (Build 3790.srv03_rtm.030324-2048)
>Server C: SQL: 8.00.760 SP3 Enterprise Edition OS: Windows 2000
>(Build 2195 SP4) NOTE: the new install has no SQL service packs applied, no
>difference in behavior
>
>Any help/suggestions/links would be greatly appreciated. Please post back
>here so that maybe any other unlucky soul that has this problem can benefit
>from the smart folks out there.
>
>thanks,
>Greg
>gjleclair AT hotmail DOT com
>
>|||Thanks for the reply, Steve.
I understand that applying the service packs would make the most sense as a
starting point...but the powers that be do not want me to do that since
"that's only one that's working".
The reason I didn't think it was server A is that all interaction between
Server A and Server B (backup/restore, attach/detach) work fine. Any
interaction between Server B and Server C result in the same consistency
problems.
As an update the SQLIOstress failed out with a series of these errors:
>>>>*** ERROR: LSN for page 277534 is out of sequence. Expected:
605885 and found 601789 in sector 15. Probably a torn page.
>>>> Byte 513 in pattern is [>] and from read is [.]
Followed by this:
>>>>----
--
>>>>Expected pattern [C] in file for page 277534.
>>>>Bytes read = 8192
>>>>Potential torn write, lost write or stale read may have been
encountered
>>>>----
--
I'm guessing that we have a hardware issue. Any thoughts? It seems like it
is up to me to "prove" that the hardware is having issues but I'm not really
sure what those errors indicate.
Once again, any help is appreciated.
-Greg
"Steve Kass" <skass@.drew.edu> wrote in message
news:%23bYZld26DHA.2556@.TK2MSFTNGP09.phx.gbl...
> Greg,
> Step 1: install SQL Server service pack 3a and Win2K service pack 4 on
> server A.
> Step 2: see if you are still having trouble.
> I wouldn't be so sure it's server C with the problem. Server A, which
> has no SQL Server service packs installed, created the backup.
> You mentioned briefly a problem detaching from B and attaching to C. If
> that is a problem that is reproducible from scratch without any contact
> with Server A, post the details of what's going on with that.
> There are hardware issues that can cause this kind of problem that might
> not be called hardware problems, such as the one described in
> http://support.microsoft.com:80/support/kb/articles/q268/4/81.asp, but I
> doubt you'll get much help asking why things aren't working on an
> non-updated server.
> SK
> Greg wrote:
> >I have one SQL instance that is giving me problems: everytime I restore
a
> >database to it, the database has many consistency errors.
> >I have 3 servers I can test with: Server A, Server B, and Server C.
Server
> >C is the one that's giving me problems.
> >
> >I run a DBCC CheckDB on a database on Server A, then back it up. If I
then
> >try to restore that backup on Server C, the backup works but DBCC CheckDB
> >reveals numerous errors. However, I can take that same backup file and
> >restore it on Server B, and everything is fine.
> >
> >I can spend lots of time with my corrupt database on Server C and using
DBCC
> >CheckDB (repair_rebuild or repair_allow_data_loss) and dbreindex to
finally
> >get the database to report that it has no consitency errors. HOWEVER, if
I
> >then try to back up that database and restore it on either Server A or
> >Server B, the restore works ok, but the database again is full of
> >consistency errors. Restore/backup works with no problems whatsoever
> >between Server A and Server B.
> >
> >All of these problems apply not only to backup/restore, but also if I try
to
> >just detach from Server A (or B) and attach to Server C.
> >
> >I have sees several errors in the SQL log, on Server C, 604 (and some
> >others). I wish I had the complete list but I have re-installed SQL and
> >lost the logs.
> >
> >I thought maybe it was an problem with the install, but as I just
mentioned,
> >I completely re-installed on Server C, but the problems continue. To
this
> >point in the current logs, there are no errors.
> >
> >At this point I am thinking hardware, but the network guys insist that it
> >has passed all tests. Next I am going to run SQLIOStress (
>http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com
:80/support/kb/articles/q231/6/19.asp&NoWebContent=1 )
> >and see if that turns anything up.
> >
> >
> >Oh, info on the servers:
> >
> >Server A: SQL: 8.00.194 RTM Enterprise Edition OS: Windows 2000
> >(Build 2195 SP3)
> >Server B: SQL: 8.00.760 SP3 Developer Edition OS: Windows Server
2003
> >Standard Edition (Build 3790.srv03_rtm.030324-2048)
> >Server C: SQL: 8.00.760 SP3 Enterprise Edition OS: Windows 2000
> >(Build 2195 SP4) NOTE: the new install has no SQL service packs applied,
no
> >difference in behavior
> >
> >
> >Any help/suggestions/links would be greatly appreciated. Please post
back
> >here so that maybe any other unlucky soul that has this problem can
benefit
> >from the smart folks out there.
> >
> >
> >thanks,
> >Greg
> >
> >gjleclair AT hotmail DOT com
> >
> >
> >
> >
>|||Greg,
It sure sounds like a hardware issue, but I don't have any great
suggestions. If you haven't already looked, see if these Knowledge Base
articles help at all:
http://support.microsoft.com:80/support/kb/articles/q231/6/19.asp
(and the articles it references at the bottom)
http://support.microsoft.com/default.aspx?scid=kb;en-us;268481
It is sounding more like it's server C and not the service pack, but
you never know... It does seem a little strange that restore fails so
easily, yet you have to work to get SQLIOstress to error out.
SK
Greg wrote:
>Thanks for the reply, Steve.
>I understand that applying the service packs would make the most sense as a
>starting point...but the powers that be do not want me to do that since
>"that's only one that's working".
>The reason I didn't think it was server A is that all interaction between
>Server A and Server B (backup/restore, attach/detach) work fine. Any
>interaction between Server B and Server C result in the same consistency
>problems.
>As an update the SQLIOstress failed out with a series of these errors:
>
>
>>>>*** ERROR: LSN for page 277534 is out of sequence. Expected:
>>>>
>>>>
>605885 and found 601789 in sector 15. Probably a torn page.
>
>>>>Byte 513 in pattern is [>] and from read is [.]
>>>>
>>>>
>Followed by this:
>
>>>>----
>>>>
>>>>
>--
>
>>>>Expected pattern [C] in file for page 277534.
>>>>Bytes read = 8192
>>>>Potential torn write, lost write or stale read may have been
>>>>
>>>>
>encountered
>
>>>>----
>>>>
>>>>
>--
>I'm guessing that we have a hardware issue. Any thoughts? It seems like it
>is up to me to "prove" that the hardware is having issues but I'm not really
>sure what those errors indicate.
>Once again, any help is appreciated.
>-Greg
>
>
>"Steve Kass" <skass@.drew.edu> wrote in message
>news:%23bYZld26DHA.2556@.TK2MSFTNGP09.phx.gbl...
>
>>Greg,
>>Step 1: install SQL Server service pack 3a and Win2K service pack 4 on
>>server A.
>>Step 2: see if you are still having trouble.
>>I wouldn't be so sure it's server C with the problem. Server A, which
>>has no SQL Server service packs installed, created the backup.
>>You mentioned briefly a problem detaching from B and attaching to C. If
>>that is a problem that is reproducible from scratch without any contact
>>with Server A, post the details of what's going on with that.
>>There are hardware issues that can cause this kind of problem that might
>>not be called hardware problems, such as the one described in
>>http://support.microsoft.com:80/support/kb/articles/q268/4/81.asp, but I
>>doubt you'll get much help asking why things aren't working on an
>>non-updated server.
>>SK
>>Greg wrote:
>>
>>I have one SQL instance that is giving me problems: everytime I restore
>>
>a
>
>>database to it, the database has many consistency errors.
>>I have 3 servers I can test with: Server A, Server B, and Server C.
>>
>Server
>
>>C is the one that's giving me problems.
>>I run a DBCC CheckDB on a database on Server A, then back it up. If I
>>
>then
>
>>try to restore that backup on Server C, the backup works but DBCC CheckDB
>>reveals numerous errors. However, I can take that same backup file and
>>restore it on Server B, and everything is fine.
>>I can spend lots of time with my corrupt database on Server C and using
>>
>DBCC
>
>>CheckDB (repair_rebuild or repair_allow_data_loss) and dbreindex to
>>
>finally
>
>>get the database to report that it has no consitency errors. HOWEVER, if
>>
>I
>
>>then try to back up that database and restore it on either Server A or
>>Server B, the restore works ok, but the database again is full of
>>consistency errors. Restore/backup works with no problems whatsoever
>>between Server A and Server B.
>>All of these problems apply not only to backup/restore, but also if I try
>>
>to
>
>>just detach from Server A (or B) and attach to Server C.
>>I have sees several errors in the SQL log, on Server C, 604 (and some
>>others). I wish I had the complete list but I have re-installed SQL and
>>lost the logs.
>>I thought maybe it was an problem with the install, but as I just
>>
>mentioned,
>
>>I completely re-installed on Server C, but the problems continue. To
>>
>this
>
>>point in the current logs, there are no errors.
>>At this point I am thinking hardware, but the network guys insist that it
>>has passed all tests. Next I am going to run SQLIOStress (
>>
>>http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com
>>
>:80/support/kb/articles/q231/6/19.asp&NoWebContent=1 )
>
>>and see if that turns anything up.
>>
>>Oh, info on the servers:
>>Server A: SQL: 8.00.194 RTM Enterprise Edition OS: Windows 2000
>>(Build 2195 SP3)
>>Server B: SQL: 8.00.760 SP3 Developer Edition OS: Windows Server
>>
>2003
>
>>Standard Edition (Build 3790.srv03_rtm.030324-2048)
>>Server C: SQL: 8.00.760 SP3 Enterprise Edition OS: Windows 2000
>>(Build 2195 SP4) NOTE: the new install has no SQL service packs applied,
>>
>no
>
>>difference in behavior
>>
>>Any help/suggestions/links would be greatly appreciated. Please post
>>
>back
>
>>here so that maybe any other unlucky soul that has this problem can
>>
>benefit
>
>>from the smart folks out there.
>>
>>thanks,
>>Greg
>>gjleclair AT hotmail DOT com
>>
>>
>>
>
>

Can anyone help solve this puzzle?

I have one SQL instance that is giving me problems: everytime I restore a
database to it, the database has many consistency errors.
I have 3 servers I can test with: Server A, Server B, and Server C. Server
C is the one that's giving me problems.
I run a DBCC CheckDB on a database on Server A, then back it up. If I then
try to restore that backup on Server C, the backup works but DBCC CheckDB
reveals numerous errors. However, I can take that same backup file and
restore it on Server B, and everything is fine.
I can spend lots of time with my corrupt database on Server C and using DBCC
CheckDB (repair_rebuild or repair_allow_data_loss) and dbreindex to finally
get the database to report that it has no consitency errors. HOWEVER, if I
then try to back up that database and restore it on either Server A or
Server B, the restore works ok, but the database again is full of
consistency errors. Restore/backup works with no problems whatsoever
between Server A and Server B.
All of these problems apply not only to backup/restore, but also if I try to
just detach from Server A (or B) and attach to Server C.
I have sees several errors in the SQL log, on Server C, 604 (and some
others). I wish I had the complete list but I have re-installed SQL and
lost the logs.
I thought maybe it was an problem with the install, but as I just mentioned,
I completely re-installed on Server C, but the problems continue. To this
point in the current logs, there are no errors.
At this point I am thinking hardware, but the network guys insist that it
has passed all tests. Next I am going to run SQLIOStress (
http://support.microsoft.com/defaul...&NoWebContent=1 )
and see if that turns anything up.
Oh, info on the servers:
Server A: SQL: 8.00.194 RTM Enterprise Edition OS: Windows 2000
(Build 2195 SP3)
Server B: SQL: 8.00.760 SP3 Developer Edition OS: Windows Server 2003
Standard Edition (Build 3790.srv03_rtm.030324-2048)
Server C: SQL: 8.00.760 SP3 Enterprise Edition OS: Windows 2000
(Build 2195 SP4) NOTE: the new install has no SQL service packs applied, no
difference in behavior
Any help/suggestions/links would be greatly appreciated. Please post back
here so that maybe any other unlucky soul that has this problem can benefit
from the smart folks out there.
thanks,
Greg
gjleclair AT hotmail DOT comGreg,
Step 1: install SQL Server service pack 3a and Win2K service pack 4 on
server A.
Step 2: see if you are still having trouble.
I wouldn't be so sure it's server C with the problem. Server A, which
has no SQL Server service packs installed, created the backup.
You mentioned briefly a problem detaching from B and attaching to C. If
that is a problem that is reproducible from scratch without any contact
with Server A, post the details of what's going on with that.
There are hardware issues that can cause this kind of problem that might
not be called hardware problems, such as the one described in
http://support.microsoft.com:80/sup.../q268/4/81.asp, but I
doubt you'll get much help asking why things aren't working on an
non-updated server.
SK
Greg wrote:
quote:

>I have one SQL instance that is giving me problems: everytime I restore a
>database to it, the database has many consistency errors.
>I have 3 servers I can test with: Server A, Server B, and Server C. Server
>C is the one that's giving me problems.
>I run a DBCC CheckDB on a database on Server A, then back it up. If I then
>try to restore that backup on Server C, the backup works but DBCC CheckDB
>reveals numerous errors. However, I can take that same backup file and
>restore it on Server B, and everything is fine.
>I can spend lots of time with my corrupt database on Server C and using DBC
C
>CheckDB (repair_rebuild or repair_allow_data_loss) and dbreindex to finally
>get the database to report that it has no consitency errors. HOWEVER, if I
>then try to back up that database and restore it on either Server A or
>Server B, the restore works ok, but the database again is full of
>consistency errors. Restore/backup works with no problems whatsoever
>between Server A and Server B.
>All of these problems apply not only to backup/restore, but also if I try t
o
>just detach from Server A (or B) and attach to Server C.
>I have sees several errors in the SQL log, on Server C, 604 (and some
>others). I wish I had the complete list but I have re-installed SQL and
>lost the logs.
>I thought maybe it was an problem with the install, but as I just mentioned
,
>I completely re-installed on Server C, but the problems continue. To this
>point in the current logs, there are no errors.
>At this point I am thinking hardware, but the network guys insist that it
>has passed all tests. Next I am going to run SQLIOStress (
>http://support.microsoft.com/defaul...&NoWebContent=1 )
>and see if that turns anything up.
>
>Oh, info on the servers:
>Server A: SQL: 8.00.194 RTM Enterprise Edition OS: Windows 2000
>(Build 2195 SP3)
>Server B: SQL: 8.00.760 SP3 Developer Edition OS: Windows Server 200
3
>Standard Edition (Build 3790.srv03_rtm.030324-2048)
>Server C: SQL: 8.00.760 SP3 Enterprise Edition OS: Windows 2000
>(Build 2195 SP4) NOTE: the new install has no SQL service packs applied, n
o
>difference in behavior
>
>Any help/suggestions/links would be greatly appreciated. Please post back
>here so that maybe any other unlucky soul that has this problem can benefit
>from the smart folks out there.
>
>thanks,
>Greg
>gjleclair AT hotmail DOT com
>
>
|||Thanks for the reply, Steve.
I understand that applying the service packs would make the most sense as a
starting point...but the powers that be do not want me to do that since
"that's only one that's working".
The reason I didn't think it was server A is that all interaction between
Server A and Server B (backup/restore, attach/detach) work fine. Any
interaction between Server B and Server C result in the same consistency
problems.
As an update the SQLIOstress failed out with a series of these errors:
quote:

605885 and found 601789 in sector 15. Probably a torn page.[QUOTE]
Followed by this:
[QUOTE]
--[QUOTE]
encountered[QUOTE]
--
I'm guessing that we have a hardware issue. Any thoughts? It seems like it
is up to me to "prove" that the hardware is having issues but I'm not really
sure what those errors indicate.
Once again, any help is appreciated.
-Greg
"Steve Kass" <skass@.drew.edu> wrote in message
news:%23bYZld26DHA.2556@.TK2MSFTNGP09.phx.gbl...[QUOTE]
> Greg,
> Step 1: install SQL Server service pack 3a and Win2K service pack 4 on
> server A.
> Step 2: see if you are still having trouble.
> I wouldn't be so sure it's server C with the problem. Server A, which
> has no SQL Server service packs installed, created the backup.
> You mentioned briefly a problem detaching from B and attaching to C. If
> that is a problem that is reproducible from scratch without any contact
> with Server A, post the details of what's going on with that.
> There are hardware issues that can cause this kind of problem that might
> not be called hardware problems, such as the one described in
> http://support.microsoft.com:80/sup.../q268/4/81.asp, but I
> doubt you'll get much help asking why things aren't working on an
> non-updated server.
> SK
> Greg wrote:
>
a[QUOTE]
Server[QUOTE]
then[QUOTE]
DBCC[QUOTE]
finally[QUOTE]
I[QUOTE]
to[QUOTE]
mentioned,[QUOTE]
this[QUOTE]
>http://support.microsoft.com/defaul...t.microsoft.com

:80/support/kb/articles/q231/6/19.asp&NoWebContent=1 )
quote:

2003[QUOTE]
no[QUOTE]
back[QUOTE]
benefit[QUOTE]
>
|||Greg,
It sure sounds like a hardware issue, but I don't have any great
suggestions. If you haven't already looked, see if these Knowledge Base
articles help at all:
http://support.microsoft.com:80/sup...s/q231/6/19.asp
(and the articles it references at the bottom)
http://support.microsoft.com/defaul...kb;en-us;268481
It is sounding more like it's server C and not the service pack, but
you never know... It does seem a little strange that restore fails so
easily, yet you have to work to get SQLIOstress to error out.
SK
Greg wrote:
quote:

>Thanks for the reply, Steve.
>I understand that applying the service packs would make the most sense as a
>starting point...but the powers that be do not want me to do that since
>"that's only one that's working".
>The reason I didn't think it was server A is that all interaction between
>Server A and Server B (backup/restore, attach/detach) work fine. Any
>interaction between Server B and Server C result in the same consistency
>problems.
>As an update the SQLIOstress failed out with a series of these errors:
>
>
>605885 and found 601789 in sector 15. Probably a torn page.
>
>Followed by this:
>
>
>--
>
>encountered
>
>--
>I'm guessing that we have a hardware issue. Any thoughts? It seems like i
t
>is up to me to "prove" that the hardware is having issues but I'm not reall
y
>sure what those errors indicate.
>Once again, any help is appreciated.
>-Greg
>
>
>"Steve Kass" <skass@.drew.edu> wrote in message
>news:%23bYZld26DHA.2556@.TK2MSFTNGP09.phx.gbl...
>
>a
>
>Server
>
>then
>
>DBCC
>
>finally
>
>I
>
>to
>
>mentioned,
>
>this
>
>:80/support/kb/articles/q231/6/19.asp&NoWebContent=1 )
>
>2003
>
>no
>
>back
>
>benefit
>
>
>

Can anyone Help Me??

Hi gurus,
I have been trying to export my mssql tables into mysql database using DTS. But I get a very strange error for some of my mssql tables which have "text" and "ntext" as field datatypes.The error message that i was gettins is,
"Query based insertion or updating of BLOB values is not supported".
But iam not using any BLOB values in my tables.
So if anyone has any solution for this please let me know.
Thanking you.Are using ODBC to connect the database in ur package?
Try to use SQL Oledb driver.
download latest service pack of SQL Server
download latest MDAC also,if it is not latest.|||I do not think this is going to work. when the error says blob it is talking about the text columns. avoid using text and ntext if at all possible. it usually not really needed. Find the max len of the exisiting data and perhaps change your data type.

Can anyone help me with this? Its giving me a bad headache!

Hi All,

I have a table called Prizes. Here's how it looks in design view with some value placed inside for Illustration purposes.

PrizeID 1, 2, 3, 4, 5
PromotionID 1, 1, 1, 2, 1
PrizeName 10 Cash, 5 cash, 10 cash, 15 cash, 20 cash

My challenge is that I need to write a stored procedure for example, that will find the PrizeID associated with the 4th count of the PromotionID that equals 1 . So in this example, counting to the 4th PromotionID that equalls 1 give us a PrizeID of 5.

I hope I've made myself clear! Can anyone write out a mini SP on how to do this.

Many many thanks in advance,
BradTry creating a temporary table that has an identity column(tempID), a column for PrizeID. Then use an insert statement that selects from Prizes where PromotionID=1 and order it by PrizeID ASC. Then, selecting from your temporary table where tempID=4 (or whatever count you are looking for) will return the corresponding PrizeID. The query to populate the temporary table should look something like this...

DECLARE @.temp TABLE(tempID INT IDENTITY(1,1) PRIMARY KEY,PrizeID INT);

INSERT INTO @.temp (PrizeID) SELECT PrizeID FROM Prizes WHERE PromotionID=1 ORDER BY PrizeID ASC;|||Wow, thank you! I'll give it a try tonight.

Brad

Can anyone help me with connecting to a database to search?

I'm trying to make this piece of code work, I get all of it except how I get the data from the database, what I wish to do is. On page load I wish to take the value of a querystring in the page URL called ProductID and search a database to see if it exists in a specifical table and column, if it exists I wish to make a button not visible. the code I am using is:

#############

protectedvoid Page_Load(object sender,EventArgs e)

{

// Get the querystring value

String inQueryString = Request.QueryString["ProductID"];

// Get the data from the database, using the above value

DataTable data = ??

The datasource I want to connect to is SqlDataSource1, and the table I want to search is "Reviews". I want to search in the column "ProductID" and search for the ProductID from the URL query string above.

// Did we find a product in the database?

if (data !=null &&

data.Rows.count > 0)

{

// Code to display the product's information

// We found a product, so we need to hide a button

Button5.Visible =false;

}

}

##########################

Please can somebody fill in the missing bit for me so i know how it should be, i've searched the quickstart tutorial on the menu above and I still don't understand it, as it doesn't show anything like what I want to do, and I have looked at numerous websites about the matter. If you don't have time that is okay, but If somebody does have the time to show me what I need, I would be very greatfull.

Regards

Daniel coates

anyone got any ideas? surely somebody must know what I need to do!

Regards

Dan

can anyone help me with a nested count?

Hi All,

I am trying to do a nested count and cannot seem to get it to work. I do realize I cannot do this within the expression so I have been trying to use the code block (report > report properties > code tab) to do this and I have zero experience with VB.

This is for a PO delivery report. The first expression is just counting how many lines on an individual PO are late divided by total number of lines on the PO. In second expression I would like to count how many POs that have a late line on it.


Here is what I have so far.

Expression 1 with count function (this work properly):
=iif(Fields!DS_Desired_Recv_Date.Value is nothing,
((Count(IIF(Fields!LAST_RECEIVED_DATE.Value > Fields!DESIRED_RECV_DATE.Value,1,Nothing))/Count(Fields!LINE_NO.Value))),
((Count(IIF(Fields!ACTUAL_RECV_DATE.Value > Fields!DS_Desired_Recv_Date.Value,1,Nothing))/Count(Fields!LINE_NO.Value))))

Code block:
Private Shared count as Integer
count=0
Public Function IncrementCount() As String
count = count +1
IncrementCount = CStr(count)
End Function

Expression 2
=iif(Fields!DS_Desired_Recv_Date.Value is nothing,
((Count(IIF(Fields!LAST_RECEIVED_DATE.Value > Fields!DESIRED_RECV_DATE.Value,1,Nothing))/Count(Fields!LINE_NO.Value))),
((Count(IIF(Fields!ACTUAL_RECV_DATE.Value > Fields!DS_Desired_Recv_Date.Value,1,Nothing))/Count(Fields!LINE_NO.Value))))

& IIf(iif(Fields!DS_Desired_Recv_Date.Value is nothing,
((Count(IIF(Fields!LAST_RECEIVED_DATE.Value > Fields!DESIRED_RECV_DATE.Value,1,Nothing))/Count(Fields!LINE_NO.Value))),
((Count(IIF(Fields!ACTUAL_RECV_DATE.Value > Fields!DS_Desired_Recv_Date.Value,1,Nothing))/Count(Fields!LINE_NO.Value)))) > 0, Code.IncrementCount(), Nothing)

The error:
[rsCompilerErrorInCode] There is an error on line 2 of custom code: [BC30188] Declaration expected.
Build complete -- 1 errors, 0 warnings.

Also "Code.IncrementCount()" is underlined with red zigzag indicating an error.

How do I get the code block to work with expression 2?

Thanks,

Blair

I would try changing this: Private Shared count as Integer

To this: Dim count as New Integer()

I've never used that code block portion, but it seems to me that you are trying to declare variables as part of a class when they aren't really in a class?

There is an error on line 2 of custom code: [BC30188] Declaration expected

This indicates to me that the variable count never truly got declared properly.

|||ok, thanks I will give that a try.