Showing posts with label direction. Show all posts
Showing posts with label direction. Show all posts

Friday, March 23, 2012

Need Direction on WHAT to Implement...

Please understand that I am not asking HOW to do something - but, rather, I
just need some advise on what "technology" or method I should employ...
The problem is this:
I have a client for whom I am developing a web site. The client is a bank -
therefore, the entire site will be secure (SSL).
The banks' customers will be entering account number information to the
site - and we will be storing all inputs into a SQL Server database. The SQL
Server database resides on one of OUR servers.
The bank client then wants to periodically download, on demand, the
information that its customers have entered. (And the bank wants to download
the information entered in Excel spreadsheet format.)
I need to determine how I am going to get the entered information from our
ASP.NET server to our SQL Server database in a format that will be
unreadable to us (me, my company).
Likewise, I need to make the information available to the bank to download
in a format that they CAN read.
Where do I start'
I am an experienced, MCSD.NET certified developer - and I can implement
anything.
I just need to know where to begin.
Many thanks for your assistance!
~ Celia ~?
I am an experienced, MCSD.NET certified developer - and I can implement
anything.
"Celia Oblinger" <Oblinger@.comporium.net> wrote in message
news:b208a994.0401151834.259491a1@.posting.google.com...
quote:

> Please understand that I am not asking HOW to do something - but, rather,

I
quote:

> just need some advise on what "technology" or method I should employ...
> The problem is this:
> I have a client for whom I am developing a web site. The client is a

bank -
quote:

> therefore, the entire site will be secure (SSL).
> The banks' customers will be entering account number information to the
> site - and we will be storing all inputs into a SQL Server database. The

SQL
quote:

> Server database resides on one of OUR servers.
> The bank client then wants to periodically download, on demand, the
> information that its customers have entered. (And the bank wants to

download
quote:

> the information entered in Excel spreadsheet format.)
> I need to determine how I am going to get the entered information from our
> ASP.NET server to our SQL Server database in a format that will be
> unreadable to us (me, my company).
> Likewise, I need to make the information available to the bank to download
> in a format that they CAN read.
> Where do I start'
> I am an experienced, MCSD.NET certified developer - and I can implement
> anything.
> I just need to know where to begin.
> Many thanks for your assistance!
> ~ Celia ~
|||You could create a SQL DTS package that would extract the data from SQL and
put it into a new Excel Spreadsheet on demand.
Take a look at some examples out on http://sqldts.com
Then just use SSL between IIS and SQL to protect the data. The data will
not however be encrypted in SQL. You'll need to use third party tools to
do this.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.sql

need direction on SSB replacing existing technology

Hello, I have an existing suite of applications in my company where remote laptop users enter data into a local database instance. There are several different applications with several different databases (some users run application A and C, others run A and B and D, etc). All of this data needs to make its way into both their local databases, and to the front office database. In addition, some of the data goes out of the front office to other end users (supervisors get data from people under them).

Currently, we get the data back and forth by creating text files full of SQL statements that are run on either the end user servers or the main server, and we zip and ftp these SQL Script files back and forth.

I am looking into the benefits of replacing this process with a Service Broker application, but I'm still too much of a newbie to understand how this might work. What should my messages contain? Should they contain the same SQL statements that are currently in the script files, and then a SSB process would grab the SQL and run it? Or should the message types be more specific to each application?

any pointers to articles that go beyond "here's what SSB is" would be appreciated.

matt tagliaferri

Why aren't you considering SQL Server Replication?|||I've used replication for other tasks - I've found it to be a bit difficult to manage and troubleshoot. Ansynchonous messaging seems to most closely match our existing method of sending the data around (scripts via ftp).

matt tag
|||

Implementing replication on top of Service Broker will require a lot of effort in terms of building the plumbing to read/write data, marshalling/unmarshalling, managing schemas, monitoring, configuration, etc. I'm not sure if it actually helps reduce the problem.

Service Broker is useful when you truely want to build loosely-coupled apps. That is apps that are not bound w.r.t. availability, time, schemas, administrative control, identities, scalability, etc. But it is more general purpose than replication and therefore requires more effort.

Need Direction in WHAT to Implement...

Please understand that I am not asking HOW to do something - but, rather, I
just need some advise on what "technology" or method I should employ...
The problem is this:
I have a client for whom I am developing a web site. The client is a bank -
therefore, the entire site will be secure (SSL).
The banks' customers will be entering account number information to the
site - and we will be storing all inputs into a SQL Server database. The SQL
Server database resides on one of OUR servers.
The bank client then wants to periodically download, on demand, the
information that its customers have entered. (And the bank wants to download
the information entered in Excel spreadsheet format.)
I need to determine how I am going to get the entered information from our
ASP.NET server to our SQL Server database in a format that will be
unreadable to us (me, my company).
Likewise, I need to make the information available to the bank to download
in a format that they CAN read.
Where do I start'
I am an experienced, MCSD.NET certified developer - and I can implement
anything.
I just need to know where to begin.
Many thanks for your assistance!
~ Celia ~Celia,
One thought I have on this issue is to ensure the data stored in the SQL
Database is encrypted using a strong encryption package. There are several
good third party applications that can accomplish this objective for you.
The trick then is to control where and how the data can be displayed in an
unencrypted format. If the data is encrypted in the data files, the data
is not compromised even if someone obtains a copy of the mdf and ldf files.
Control of the decryption key is crucial.
Hopefully this information will get you started on the project.
Thanks.
Gary Whitley
This posting is provided "AS IS" with no warranties, and confers no rights.

NEED DIRECTION and suggestions!

I have a HUGE project and need some guidance.
I am trying to create a database for a local university movie club that allows users to input there basic personal information (name, address, telephone number) as well as movies in there collection. The movies will be categorized by genre (comedy, roman
ce, horror, etc.) and title. I want to be able to let the users add and remove movies to their list of movies they own, I'll call it "MOVIES I OWN".
The user will also need to be able to create a SECOND list of movies they would like to see, again they can choose by genre and title. They need to also be able to add and remove from this list also, i'll call it "MOVIES I WANT TO SEE".
The last part of the project will be to match the users of "movies i want to see" with "movies I own". It will be displayed on the local university website when the user logs in and will alert the user to the match. If there is a match at a later time,
maybe the user can be emailed? Also if there is a match, perhaps the two movies can be taken off record. I would need it to be able to handle a small amount of users now logged in at the same time , but would like for it to handle several hundred to thou
sand users logged on at the same time in the distant future with out performance problems.
I am not sure if sql server 2000 is the best or perhaps oracle. I am currently trying this on mySQL but currently lost in a forest of data. Any guidance suggestions will be greatly appreciated. I am pretty new to this so please be kind...
Most databases can do what you need, in terms of your database design. I
feel you should research more on the front-end, to address the 'several
hundred to thousand users' issue. A database can handle that load, given
the right hardware (and budget). But for cost and efficiency purposes, your
application layer should be capable of creating and managing a pool of
transactions so that connnections can be shared. It should also allow you
to specify the transaction isolation level to deal with concurrency issues.
Peter Yeoh
http://www.yohz.com
Need smaller backup files? Try MiniSQLBackup
"new_GUY" <new_GUY@.discussions.microsoft.com> wrote in message
news:51334783-729B-4E94-A7B8-D72E922DEAF4@.microsoft.com...
> I have a HUGE project and need some guidance.
> I am trying to create a database for a local university movie club that
allows users to input there basic personal information (name, address,
telephone number) as well as movies in there collection. The movies will be
categorized by genre (comedy, romance, horror, etc.) and title. I want to
be able to let the users add and remove movies to their list of movies they
own, I'll call it "MOVIES I OWN".
> The user will also need to be able to create a SECOND list of movies they
would like to see, again they can choose by genre and title. They need to
also be able to add and remove from this list also, i'll call it "MOVIES I
WANT TO SEE".
> The last part of the project will be to match the users of "movies i want
to see" with "movies I own". It will be displayed on the local university
website when the user logs in and will alert the user to the match. If
there is a match at a later time, maybe the user can be emailed? Also if
there is a match, perhaps the two movies can be taken off record. I would
need it to be able to handle a small amount of users now logged in at the
same time , but would like for it to handle several hundred to thousand
users logged on at the same time in the distant future with out performance
problems.
> I am not sure if sql server 2000 is the best or perhaps oracle. I am
currently trying this on mySQL but currently lost in a forest of data. Any
guidance suggestions will be greatly appreciated. I am pretty new to this
so please be kind...
>

NEED DIRECTION and suggestions!

I have a HUGE project and need some guidance.
I am trying to create a database for a local university movie club that allo
ws users to input there basic personal information (name, address, telephone
number) as well as movies in there collection. The movies will be categori
zed by genre (comedy, roman
ce, horror, etc.) and title. I want to be able to let the users add and rem
ove movies to their list of movies they own, I'll call it "MOVIES I OWN".
The user will also need to be able to create a SECOND list of movies they wo
uld like to see, again they can choose by genre and title. They need to als
o be able to add and remove from this list also, i'll call it "MOVIES I WANT
TO SEE".
The last part of the project will be to match the users of "movies i want to
see" with "movies I own". It will be displayed on the local university web
site when the user logs in and will alert the user to the match. If there i
s a match at a later time,
maybe the user can be emailed? Also if there is a match, perhaps the two mo
vies can be taken off record. I would need it to be able to handle a small a
mount of users now logged in at the same time , but would like for it to han
dle several hundred to thou
sand users logged on at the same time in the distant future with out perform
ance problems.
I am not sure if sql server 2000 is the best or perhaps oracle. I am curren
tly trying this on mysql but currently lost in a forest of data. Any guidanc
e suggestions will be greatly appreciated. I am pretty new to this so pleas
e be kind...Most databases can do what you need, in terms of your database design. I
feel you should research more on the front-end, to address the 'several
hundred to thousand users' issue. A database can handle that load, given
the right hardware (and budget). But for cost and efficiency purposes, your
application layer should be capable of creating and managing a pool of
transactions so that connnections can be shared. It should also allow you
to specify the transaction isolation level to deal with concurrency issues.
Peter Yeoh
http://www.yohz.com
Need smaller backup files? Try MiniSQLBackup
"new_GUY" <new_GUY@.discussions.microsoft.com> wrote in message
news:51334783-729B-4E94-A7B8-D72E922DEAF4@.microsoft.com...
> I have a HUGE project and need some guidance.
> I am trying to create a database for a local university movie club that
allows users to input there basic personal information (name, address,
telephone number) as well as movies in there collection. The movies will be
categorized by genre (comedy, romance, horror, etc.) and title. I want to
be able to let the users add and remove movies to their list of movies they
own, I'll call it "MOVIES I OWN".
> The user will also need to be able to create a SECOND list of movies they
would like to see, again they can choose by genre and title. They need to
also be able to add and remove from this list also, i'll call it "MOVIES I
WANT TO SEE".
> The last part of the project will be to match the users of "movies i want
to see" with "movies I own". It will be displayed on the local university
website when the user logs in and will alert the user to the match. If
there is a match at a later time, maybe the user can be emailed? Also if
there is a match, perhaps the two movies can be taken off record. I would
need it to be able to handle a small amount of users now logged in at the
same time , but would like for it to handle several hundred to thousand
users logged on at the same time in the distant future with out performance
problems.
> I am not sure if sql server 2000 is the best or perhaps oracle. I am
currently trying this on mysql but currently lost in a forest of data. Any
guidance suggestions will be greatly appreciated. I am pretty new to this
so please be kind...
>

NEED DIRECTION and suggestions!

I have a HUGE project and need some guidance.
I am trying to create a database for a local university movie club that allows users to input there basic personal information (name, address, telephone number) as well as movies in there collection. The movies will be categorized by genre (comedy, romance, horror, etc.) and title. I want to be able to let the users add and remove movies to their list of movies they own, I'll call it "MOVIES I OWN".
The user will also need to be able to create a SECOND list of movies they would like to see, again they can choose by genre and title. They need to also be able to add and remove from this list also, i'll call it "MOVIES I WANT TO SEE".
The last part of the project will be to match the users of "movies i want to see" with "movies I own". It will be displayed on the local university website when the user logs in and will alert the user to the match. If there is a match at a later time, maybe the user can be emailed? Also if there is a match, perhaps the two movies can be taken off record. I would need it to be able to handle a small amount of users now logged in at the same time , but would like for it to handle several hundred to thousand users logged on at the same time in the distant future with out performance problems.
I am not sure if sql server 2000 is the best or perhaps oracle. I am currently trying this on mySQL but currently lost in a forest of data. Any guidance suggestions will be greatly appreciated. I am pretty new to this so please be kind...Most databases can do what you need, in terms of your database design. I
feel you should research more on the front-end, to address the 'several
hundred to thousand users' issue. A database can handle that load, given
the right hardware (and budget). But for cost and efficiency purposes, your
application layer should be capable of creating and managing a pool of
transactions so that connnections can be shared. It should also allow you
to specify the transaction isolation level to deal with concurrency issues.
Peter Yeoh
http://www.yohz.com
Need smaller backup files? Try MiniSQLBackup
"new_GUY" <new_GUY@.discussions.microsoft.com> wrote in message
news:51334783-729B-4E94-A7B8-D72E922DEAF4@.microsoft.com...
> I have a HUGE project and need some guidance.
> I am trying to create a database for a local university movie club that
allows users to input there basic personal information (name, address,
telephone number) as well as movies in there collection. The movies will be
categorized by genre (comedy, romance, horror, etc.) and title. I want to
be able to let the users add and remove movies to their list of movies they
own, I'll call it "MOVIES I OWN".
> The user will also need to be able to create a SECOND list of movies they
would like to see, again they can choose by genre and title. They need to
also be able to add and remove from this list also, i'll call it "MOVIES I
WANT TO SEE".
> The last part of the project will be to match the users of "movies i want
to see" with "movies I own". It will be displayed on the local university
website when the user logs in and will alert the user to the match. If
there is a match at a later time, maybe the user can be emailed? Also if
there is a match, perhaps the two movies can be taken off record. I would
need it to be able to handle a small amount of users now logged in at the
same time , but would like for it to handle several hundred to thousand
users logged on at the same time in the distant future with out performance
problems.
> I am not sure if sql server 2000 is the best or perhaps oracle. I am
currently trying this on mySQL but currently lost in a forest of data. Any
guidance suggestions will be greatly appreciated. I am pretty new to this
so please be kind...
>sql

Wednesday, March 7, 2012

Need a kick in the right direction w/this query

Here is a link to the DDL since it would take up a lot of room here.
http://damageinc.org/DDL.html
After you use that to generate the table and some sample data, here is the
problem I need help with.
You will see the following data, if you use this query...
SELECT DISTINCT Apps.AppName, TestCases.TestCase , Tests.Attributes,
Reports.Result, Reports.ReportDate
FROM
Reports
LEFT OUTER JOIN TestCases ON TestCases.TestCaseID = Reports.TestID
LEFT OUTER JOIN Tests ON TestCases.TestCaseID = Tests.TestID
LEFT OUTER JOIN Apps ON TestCases.AppID = Apps.AppID
AppName TestCase Attribute
Result ReportDate
Test App 1 Run for 30 minutes Attribute 1 Fail
2006-06-25 19:58:31.800
Test App 1 Run for 30 minutes Attribute 1 Pass
2006-06-25 19:58:29.800
Test App 1 Run for 30 minutes Attribute 1 Pass
2006-06-25 19:58:30.800
Test App 1 Run for 45 minutes Attribute 2 Fail
2006-06-25 19:58:33.800
Test App 1 Run for 45 minutes Attribute 2 Fail
2006-06-25 19:58:34.800
Test App 1 Run for 45 minutes Attribute 2 Pass
2006-06-25 19:58:32.800
Test App 1 Run for 60 minutes Attribute 3 Fail
2006-06-25 19:58:36.863
Test App 1 Run for 60 minutes Attribute 3 Pass
2006-06-25 19:58:35.863
Test App 1 Run for 60 minutes Attribute 3 Pass
2006-06-25 19:58:37.863
What I need to get is the count most recent result per TestCase regardless
of attribute.
So I was trying to do it visually by using this query..
SELECT tc.TestCase, tc.mostRecent, tc.Result
FROM Reports rp
RIGHT JOIN
(
SELECT TestCases.TestCase ,Reports.Result, MAX ( Reports.ReportDate ) AS
mostRecent
FROM Reports
LEFT OUTER JOIN TestCases ON TestCases.TestCaseID = Reports.TestID
LEFT OUTER JOIN Tests ON TestCases.TestCaseID = Tests.TestID
WHERE ( (Tests.Attributes = 'Attribute 1') OR (Tests.Attributes =
'Attribute 2') OR (Tests.Attributes = 'Attribute 3') )
GROUP BY TestCases.TestCase, Result) tc ON (tc.mostRecent =
rp.ReportDate ) ORDER BY TestCAse
Which will give you this data...
TestCase mostRecent Result
Run for 30 minutes 2006-06-25 19:58:31.800 Fail
Run for 30 minutes 2006-06-25 19:58:30.800 Pass
Run for 45 minutes 2006-06-25 19:58:34.800 Fail
Run for 45 minutes 2006-06-25 19:58:32.800 Pass
Run for 60 minutes 2006-06-25 19:58:36.863 Fail
Run for 60 minutes 2006-06-25 19:58:37.863 Pass
Which as you can tell is giving me both the most recent pass & fail result,
where I want the most recent result regardless of Pass/Fail.
Which in turn, makes my count query wrong as well...
SELECT COUNT(DISTINCT tc.TestCase) As Count,
COUNT(DISTINCT CASE rp.Result WHEN 'Pass' THEN rp.ReportID ELSE NULL END) as
Pass,
COUNT(DISTINCT CASE rp.Result WHEN 'Fail' THEN rp.ReportID ELSE NULL END) as
Fail
FROM Reports rp
RIGHT JOIN
(
SELECT TestCases.TestCase ,Reports.Result, MAX ( Reports.ReportDate ) AS
mostRecent
FROM Reports
LEFT OUTER JOIN TestCases ON TestCases.TestCaseID = Reports.TestID
LEFT OUTER JOIN Tests ON TestCases.TestCaseID = Tests.TestID
WHERE ( (Tests.Attributes = 'Attribute 1') OR (Tests.Attributes =
'Attribute 2') OR (Tests.Attributes = 'Attribute 3') )
GROUP BY TestCases.TestCase, Result) tc ON (tc.mostRecent = rp.ReportDate )
Which will give me
Count Pass Fail
3 3 3
Instead of the result I am looking for of..
Count Pass Fail
3 1 2Select Count(*) As 'Count',
Sum(Case When Result = 'Pass' Then 1 Else 0 End) As 'Pass',
Sum(Case When Result = 'Fail' Then 1 Else 0 End) As 'Fail'
From Reports r
Where r.ReportDate In
(Select Max(r.ReportDate)
From Reports r
Inner Join TestCases tc On r.TestID = tc.TestCaseID
Inner Join Tests t On tc.TestCaseID = t.TestID
Inner Join Apps a On tc.AppID = a.AppID
Where t.Attributes In ('Attribute 1', 'Attribute 2', 'Attribute 3')
Group By a.AppName, tc.TestCase)
The above query assumes that there are no duplicates in Reports.ReportDate.
I changed your Left Outer Joins to Inner Joins since if for a Report row,
you don't have a TestCases row and a Tests row, then the Attributes column
will nave NULL in it, so the where condition would be false. So your Left
Outer Join gives the same result as an Inner Join, but Inner Joins are ofter
faster.
BTW, your DDL is not too long to post to this group (IMHO) and you will have
better luck if you just include it the post rather than a web site since
some people are reluctant to go to an unknown site.
Tom
"Lucas Graf" <lgraf2000@.comcast.net> wrote in message
news:uJYRRBNmGHA.4064@.TK2MSFTNGP02.phx.gbl...
> Here is a link to the DDL since it would take up a lot of room here.
> http://damageinc.org/DDL.html
> After you use that to generate the table and some sample data, here is the
> problem I need help with.
> You will see the following data, if you use this query...
>
> SELECT DISTINCT Apps.AppName, TestCases.TestCase , Tests.Attributes,
> Reports.Result, Reports.ReportDate
> FROM
> Reports
> LEFT OUTER JOIN TestCases ON TestCases.TestCaseID = Reports.TestID
> LEFT OUTER JOIN Tests ON TestCases.TestCaseID = Tests.TestID
> LEFT OUTER JOIN Apps ON TestCases.AppID = Apps.AppID
> AppName TestCase Attribute Result
> ReportDate
> Test App 1 Run for 30 minutes Attribute 1 Fail
> 2006-06-25 19:58:31.800
> Test App 1 Run for 30 minutes Attribute 1 Pass
> 2006-06-25 19:58:29.800
> Test App 1 Run for 30 minutes Attribute 1 Pass
> 2006-06-25 19:58:30.800
> Test App 1 Run for 45 minutes Attribute 2 Fail
> 2006-06-25 19:58:33.800
> Test App 1 Run for 45 minutes Attribute 2 Fail
> 2006-06-25 19:58:34.800
> Test App 1 Run for 45 minutes Attribute 2 Pass
> 2006-06-25 19:58:32.800
> Test App 1 Run for 60 minutes Attribute 3 Fail
> 2006-06-25 19:58:36.863
> Test App 1 Run for 60 minutes Attribute 3 Pass
> 2006-06-25 19:58:35.863
> Test App 1 Run for 60 minutes Attribute 3 Pass
> 2006-06-25 19:58:37.863
>
> What I need to get is the count most recent result per TestCase regardless
> of attribute.
> So I was trying to do it visually by using this query..
> SELECT tc.TestCase, tc.mostRecent, tc.Result
> FROM Reports rp
> RIGHT JOIN
> (
> SELECT TestCases.TestCase ,Reports.Result, MAX ( Reports.ReportDate ) AS
> mostRecent
> FROM Reports
> LEFT OUTER JOIN TestCases ON TestCases.TestCaseID = Reports.TestID
> LEFT OUTER JOIN Tests ON TestCases.TestCaseID = Tests.TestID
> WHERE ( (Tests.Attributes = 'Attribute 1') OR (Tests.Attributes =
> 'Attribute 2') OR (Tests.Attributes = 'Attribute 3') )
> GROUP BY TestCases.TestCase, Result) tc ON (tc.mostRecent =
> rp.ReportDate ) ORDER BY TestCAse
>
> Which will give you this data...
> TestCase mostRecent Result
> Run for 30 minutes 2006-06-25 19:58:31.800 Fail
> Run for 30 minutes 2006-06-25 19:58:30.800 Pass
> Run for 45 minutes 2006-06-25 19:58:34.800 Fail
> Run for 45 minutes 2006-06-25 19:58:32.800 Pass
> Run for 60 minutes 2006-06-25 19:58:36.863 Fail
> Run for 60 minutes 2006-06-25 19:58:37.863 Pass
> Which as you can tell is giving me both the most recent pass & fail
> result, where I want the most recent result regardless of Pass/Fail.
> Which in turn, makes my count query wrong as well...
> SELECT COUNT(DISTINCT tc.TestCase) As Count,
> COUNT(DISTINCT CASE rp.Result WHEN 'Pass' THEN rp.ReportID ELSE NULL END)
> as Pass,
> COUNT(DISTINCT CASE rp.Result WHEN 'Fail' THEN rp.ReportID ELSE NULL END)
> as Fail
> FROM Reports rp
> RIGHT JOIN
> (
> SELECT TestCases.TestCase ,Reports.Result, MAX ( Reports.ReportDate ) AS
> mostRecent
> FROM Reports
> LEFT OUTER JOIN TestCases ON TestCases.TestCaseID = Reports.TestID
> LEFT OUTER JOIN Tests ON TestCases.TestCaseID = Tests.TestID
> WHERE ( (Tests.Attributes = 'Attribute 1') OR (Tests.Attributes =
> 'Attribute 2') OR (Tests.Attributes = 'Attribute 3') )
> GROUP BY TestCases.TestCase, Result) tc ON (tc.mostRecent =
> rp.ReportDate )
> Which will give me
>
> Count Pass Fail
> 3 3 3
>
> Instead of the result I am looking for of..
> Count Pass Fail
> 3 1 2
>
>|||Lucas
Thanks fro posting DDL
See if this helps you
SELECT TestCase,COUNT(CASE WHEN Result='Fail' THEN ReportDate END) AS
'Fail',
COUNT(CASE WHEN Result='Pass' THEN ReportDate END) AS 'Pass'
FROM
(
SELECT Apps.AppName, TestCases.TestCase , Tests.Attributes,
Reports.Result, Reports.ReportDate
FROM
Reports
LEFT OUTER JOIN TestCases ON TestCases.TestCaseID = Reports.TestID
LEFT OUTER JOIN Tests ON TestCases.TestCaseID = Tests.TestID
LEFT OUTER JOIN Apps ON TestCases.AppID = Apps.AppID
) AS Der GROUP BY TestCase
"Lucas Graf" <lgraf2000@.comcast.net> wrote in message
news:uJYRRBNmGHA.4064@.TK2MSFTNGP02.phx.gbl...
> Here is a link to the DDL since it would take up a lot of room here.
> http://damageinc.org/DDL.html
> After you use that to generate the table and some sample data, here is the
> problem I need help with.
> You will see the following data, if you use this query...
>
> SELECT DISTINCT Apps.AppName, TestCases.TestCase , Tests.Attributes,
> Reports.Result, Reports.ReportDate
> FROM
> Reports
> LEFT OUTER JOIN TestCases ON TestCases.TestCaseID = Reports.TestID
> LEFT OUTER JOIN Tests ON TestCases.TestCaseID = Tests.TestID
> LEFT OUTER JOIN Apps ON TestCases.AppID = Apps.AppID
> AppName TestCase Attribute Result
> ReportDate
> Test App 1 Run for 30 minutes Attribute 1 Fail
> 2006-06-25 19:58:31.800
> Test App 1 Run for 30 minutes Attribute 1 Pass
> 2006-06-25 19:58:29.800
> Test App 1 Run for 30 minutes Attribute 1 Pass
> 2006-06-25 19:58:30.800
> Test App 1 Run for 45 minutes Attribute 2 Fail
> 2006-06-25 19:58:33.800
> Test App 1 Run for 45 minutes Attribute 2 Fail
> 2006-06-25 19:58:34.800
> Test App 1 Run for 45 minutes Attribute 2 Pass
> 2006-06-25 19:58:32.800
> Test App 1 Run for 60 minutes Attribute 3 Fail
> 2006-06-25 19:58:36.863
> Test App 1 Run for 60 minutes Attribute 3 Pass
> 2006-06-25 19:58:35.863
> Test App 1 Run for 60 minutes Attribute 3 Pass
> 2006-06-25 19:58:37.863
>
> What I need to get is the count most recent result per TestCase regardless
> of attribute.
> So I was trying to do it visually by using this query..
> SELECT tc.TestCase, tc.mostRecent, tc.Result
> FROM Reports rp
> RIGHT JOIN
> (
> SELECT TestCases.TestCase ,Reports.Result, MAX ( Reports.ReportDate ) AS
> mostRecent
> FROM Reports
> LEFT OUTER JOIN TestCases ON TestCases.TestCaseID = Reports.TestID
> LEFT OUTER JOIN Tests ON TestCases.TestCaseID = Tests.TestID
> WHERE ( (Tests.Attributes = 'Attribute 1') OR (Tests.Attributes =
> 'Attribute 2') OR (Tests.Attributes = 'Attribute 3') )
> GROUP BY TestCases.TestCase, Result) tc ON (tc.mostRecent =
> rp.ReportDate ) ORDER BY TestCAse
>
> Which will give you this data...
> TestCase mostRecent Result
> Run for 30 minutes 2006-06-25 19:58:31.800 Fail
> Run for 30 minutes 2006-06-25 19:58:30.800 Pass
> Run for 45 minutes 2006-06-25 19:58:34.800 Fail
> Run for 45 minutes 2006-06-25 19:58:32.800 Pass
> Run for 60 minutes 2006-06-25 19:58:36.863 Fail
> Run for 60 minutes 2006-06-25 19:58:37.863 Pass
> Which as you can tell is giving me both the most recent pass & fail
> result, where I want the most recent result regardless of Pass/Fail.
> Which in turn, makes my count query wrong as well...
> SELECT COUNT(DISTINCT tc.TestCase) As Count,
> COUNT(DISTINCT CASE rp.Result WHEN 'Pass' THEN rp.ReportID ELSE NULL END)
> as Pass,
> COUNT(DISTINCT CASE rp.Result WHEN 'Fail' THEN rp.ReportID ELSE NULL END)
> as Fail
> FROM Reports rp
> RIGHT JOIN
> (
> SELECT TestCases.TestCase ,Reports.Result, MAX ( Reports.ReportDate ) AS
> mostRecent
> FROM Reports
> LEFT OUTER JOIN TestCases ON TestCases.TestCaseID = Reports.TestID
> LEFT OUTER JOIN Tests ON TestCases.TestCaseID = Tests.TestID
> WHERE ( (Tests.Attributes = 'Attribute 1') OR (Tests.Attributes =
> 'Attribute 2') OR (Tests.Attributes = 'Attribute 3') )
> GROUP BY TestCases.TestCase, Result) tc ON (tc.mostRecent =
> rp.ReportDate )
> Which will give me
>
> Count Pass Fail
> 3 3 3
>
> Instead of the result I am looking for of..
> Count Pass Fail
> 3 1 2
>
>|||Hi guys, thanks for the help so far.
I am really close now. One remaining problem, say there is no report s for
say testcase 3 (delete any reports w/the TestID of 3 in it).
Running the query will give me
Count Pass Fail
2 0 2
What i need is to show the total test cases even if there is no result(s)
for some, and the count of the ones where there are results for like so..
Count Pass Fail
3 0 2|||Select Count(*)
+ (Select Count(*) From
TestCases tc
Where Not Exists (Select 1 From Reports r Where r.TestID =
tc.TestCaseID)) As 'Count',
Sum(Case When Result = 'Pass' Then 1 Else 0 End) As 'Pass',
Sum(Case When Result = 'Fail' Then 1 Else 0 End) As 'Fail'
From Reports r
Where r.ReportDate In
(Select Max(r.ReportDate)
From Reports r
Inner Join TestCases tc On r.TestID = tc.TestCaseID
Inner Join Tests t On tc.TestCaseID = t.TestID
Inner Join Apps a On tc.AppID = a.AppID
Where t.Attributes In ('Attribute 1', 'Attribute 2', 'Attribute 3')
Group By a.AppName, tc.TestCase)
Tom
"Lucas Graf" <lgraf2000@.comcast.net> wrote in message
news:uEX$yZVmGHA.492@.TK2MSFTNGP05.phx.gbl...
> Hi guys, thanks for the help so far.
> I am really close now. One remaining problem, say there is no report s
> for say testcase 3 (delete any reports w/the TestID of 3 in it).
> Running the query will give me
> Count Pass Fail
> 2 0 2
>
> What i need is to show the total test cases even if there is no result(s)
> for some, and the count of the ones where there are results for like so..
> Count Pass Fail
> 3 0 2
>
>|||Thanks Tom "the master" Cooper!
I appreciate everyone's help as well, every time I post a question I get
another nugget of i nformation to store away.
"Tom Cooper" <tom.no.spam.please.cooper@.comcast.net> wrote in message
news:wvKdnRf8W_cuoT3ZnZ2dnUVZ_oKdnZ2d@.co
mcast.com...
> Select Count(*)
> + (Select Count(*) From
> TestCases tc
> Where Not Exists (Select 1 From Reports r Where r.TestID =
> tc.TestCaseID)) As 'Count',
> Sum(Case When Result = 'Pass' Then 1 Else 0 End) As 'Pass',
> Sum(Case When Result = 'Fail' Then 1 Else 0 End) As 'Fail'
> From Reports r
> Where r.ReportDate In
> (Select Max(r.ReportDate)
> From Reports r
> Inner Join TestCases tc On r.TestID = tc.TestCaseID
> Inner Join Tests t On tc.TestCaseID = t.TestID
> Inner Join Apps a On tc.AppID = a.AppID
> Where t.Attributes In ('Attribute 1', 'Attribute 2', 'Attribute 3')
> Group By a.AppName, tc.TestCase)
> Tom
> "Lucas Graf" <lgraf2000@.comcast.net> wrote in message
> news:uEX$yZVmGHA.492@.TK2MSFTNGP05.phx.gbl...
>|||Tom, maybe I could pick your brain one more time :)
For whatever reason on my actual tables I still can't get what I need :(
I have updated the DDL with the actual tables and a sample of table data of
what I am actually using.
http://damageinc.org/DDL.html (The DDL is too large to post, the message
gets kicked back to me)
AFter you enter that DDL
If you run the query..
SELECT Apps.AppName, Tests.TestCase, TestCases.Type
FROM
TestCases
LEFT OUTER JOIN Apps ON TestCases.AppID = Apps.ID
LEFT OUTER JOIN Tests ON TestCases.TestID = Tests.ID
WHERE
(
(
(Proj1 = '87' OR Proj2 = '87' OR Proj3 = '87' OR Proj4 = '87' OR Proj5 =
'87')
OR
(Proj1 = '88' OR Proj2 = '88' OR Proj3 = '88' OR Proj4 = '88' OR Proj5 =
'88')
)
AND (TestCases.Card = 'G71_D' OR TestCases.Card = 'G70_D' OR TestCases.Card
= 'G72_D' OR TestCases.Card = 'G73_D')
AND TestCases.OS = 'Windows Vista'
)
GROUP BY AppName, TestCase,TestCases.Type
You will see
AppName TestCase
Type
3D Mark 2003 Benchmark: 1600x1200x32 4xAA 8x Aniso D3D Benchmarks
3D Mark 2003 Benchmark: 1600x1200x32 4xAA 8x Aniso Games
3D Mark 2003 Benchmark: Default 2x AA 4x Aniso D3D
Benchmarks
3D Mark 2003 Benchmark: Default 2x AA 4x Aniso G ames
.
.
.
.
There are 97 tests there.
What I need is that 97 for the count, then the count of the most recent
pass/fail result(s) (if there is a result) for each of those tests.
Using
Select Count(*) As 'Count',
Sum(Case When Result = 'Pass' Then 1 Else 0 End) As 'Pass',
Sum(Case When Result = 'Fail' Then 1 Else 0 End) As 'Fail'
From Reports r
Where r.ReportDate In
(Select Max(r.ReportDate)
From Reports r
Inner Join TestCases tc On r.TestCaseID = tc.ID
Inner Join Tests t On tc.TestID = t.ID
Inner Join Apps a On tc.AppID = a.ID
WHERE
(
(
(tc.Proj1 = '87' OR tc.Proj2 = '87' OR tc.Proj3 = '87' OR tc.Proj4 = '87'
OR tc.Proj5 = '87')
OR
(tc.Proj1 = '88' OR tc.Proj2 = '88' OR tc.Proj3 = '88' OR tc.Proj4 = '88'
OR tc.Proj5 = '88')
)
AND (tc.Card = 'G71_D' OR tc.Card = 'G70_D' OR tc.Card = 'G72_D' OR tc.Card
= 'G73_D')
AND tc.OS = 'Windows Vista'
)
Group By a.AppName, t.TestCase)
Gives me
Count Pass Fail
25 2 23
Which is obviously wrong, since the Count should be 97.
I have to be overthinking something here...
========================================
====================================
========