Click here to Skip to main content
15,890,123 members
Home / Discussions / Database
   

Database

 
QuestionIs there a performance difference? Pin
Marc Clifton10-Sep-04 8:13
mvaMarc Clifton10-Sep-04 8:13 
AnswerRe: Is there a performance difference? Pin
Grimolfr10-Sep-04 9:15
Grimolfr10-Sep-04 9:15 
AnswerRe: Is there a performance difference? Pin
je_gonzalez10-Sep-04 10:45
je_gonzalez10-Sep-04 10:45 
AnswerRe: Is there a performance difference? Pin
Steven Campbell10-Sep-04 18:33
Steven Campbell10-Sep-04 18:33 
AnswerRe: Is there a performance difference? Pin
Mike Ellison12-Sep-04 5:35
Mike Ellison12-Sep-04 5:35 
QuestionHow do I clear a datasource from a bound control? Pin
Bart-Man10-Sep-04 4:05
Bart-Man10-Sep-04 4:05 
AnswerRe: How do I clear a datasource from a bound control? Pin
sreejith ss nair11-Sep-04 23:55
sreejith ss nair11-Sep-04 23:55 
GeneraltSQL query Pin
partt10-Sep-04 2:57
partt10-Sep-04 2:57 
I have this code below, but I want the "Available" column to be the @@Rowcount specific to the GroupID. Right now with what I figured below, it subtracts the rowcount from both GroupID 859 and 860.

CREATE PROCEDURE usp_Groups
@StudyNo char(16)
AS
declare @Fill table (GroupID varchar(5), TesterID char(7))
declare @Ct table (GroupID varchar(5), TesterID char(7), Filled varchar(4))
declare @Out table (GroupID varchar(5), TesterID char(7), Filled varchar(4))

insert @Fill
SELECT DISTINCT tGroup.GroupID, tResultQue.TesterID
FROM tGroup INNER JOIN
tResultQue ON tGroup.GroupID = tResultQue.GroupID
where (tResultQue.QueStatusID >= '20') and
(tResultQue.QueStatusID <= '22') and tGroup.StudyNo = @StudyNo

insert @Ct
select distinct F.GroupID, F.TesterID, @@Rowcount as Filled
from @Fill F
Group by F.GroupID, F.TesterID

insert @Out
select distinct F.GroupID, F.TesterID, Ct.Filled
from @Fill F left join @Ct Ct on (F.GroupID = Ct.GroupID)

SELECT distinct tGroup.GroupID, tGroup.ScheduleStamp, tFacility.FacilitiesDescription, tGroup.NotToExceed, (tGroup.NotToExceed- Gonzo.Filled) as Available
FROM tGroup INNER JOIN
tFacility ON tGroup.FacilityID = tFacility.FacilityID left join @Out Gonzo on (tGroup.GroupID = Gonzo.GroupID) left join @Fill J on (tGroup.GroupID = J.GroupID) left join @Ct Cet on (tGroup.GroupID = Cet.GroupID)
where tGroup.StudyNo = @StudyNo
GO
*************************************************
This is what the output looks like:
GroupID|ScheduleStamp|FacilitiesDescription|NotToExceed|Available
-----------------------------------------------------------------
859|2004-02-24|Building A|15|11
860|2004-02-24|Building A|10|6
861|2004-05-04|Building A|10|NULL
***************************************************
This is what it should look like:
GroupID|ScheduleStamp|FacilitiesDescription|NotToExceed|Available
-----------------------------------------------------------------
859|2004-02-24|Building A|15|12
860|2004-02-24|Building A|10|9
861|2004-05-04|Building A|10|NULL

Thank You!
GeneralRe: tSQL query Pin
partt10-Sep-04 3:06
partt10-Sep-04 3:06 
GeneralGetting Server List. Pin
Sumit Domyan9-Sep-04 21:17
Sumit Domyan9-Sep-04 21:17 
GeneralRe: Getting Server List. Pin
David Salter9-Sep-04 22:39
David Salter9-Sep-04 22:39 
Generalnot detecting local MSDE Pin
Steven Dahlin9-Sep-04 17:00
Steven Dahlin9-Sep-04 17:00 
GeneralRe: not detecting local MSDE Pin
Christian Graus9-Sep-04 17:28
protectorChristian Graus9-Sep-04 17:28 
GeneralExtremely slow performance of OleDbDataAdapter.Fill method Pin
rotarinn9-Sep-04 7:05
rotarinn9-Sep-04 7:05 
GeneralRe: Extremely slow performance of OleDbDataAdapter.Fill method Pin
rotarinn9-Sep-04 8:21
rotarinn9-Sep-04 8:21 
QuestionReading From Procedures? Pin
Sumit Domyan9-Sep-04 2:53
Sumit Domyan9-Sep-04 2:53 
AnswerRe: Reading From Procedures? Pin
Colin Angus Mackay9-Sep-04 3:20
Colin Angus Mackay9-Sep-04 3:20 
GeneralRe: Reading From Procedures? Pin
Sumit Domyan9-Sep-04 18:55
Sumit Domyan9-Sep-04 18:55 
GeneralDTS packages Pin
Sudee8-Sep-04 22:42
Sudee8-Sep-04 22:42 
GeneralRe: DTS packages Pin
andyharman12-Sep-04 1:50
professionalandyharman12-Sep-04 1:50 
GeneralStored Procedure Pin
Goodway8-Sep-04 4:35
Goodway8-Sep-04 4:35 
GeneralRe: Stored Procedure Pin
Colin Angus Mackay8-Sep-04 5:06
Colin Angus Mackay8-Sep-04 5:06 
GeneralSQL server logs Pin
Imtiaz Murtaza8-Sep-04 2:08
Imtiaz Murtaza8-Sep-04 2:08 
GeneralSql Query Pin
rkyawal8-Sep-04 0:41
rkyawal8-Sep-04 0:41 
GeneralRe: Sql Query Pin
Colin Angus Mackay8-Sep-04 5:13
Colin Angus Mackay8-Sep-04 5:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.