Click here to Skip to main content
15,889,857 members
Home / Discussions / Database
   

Database

 
QuestionHiring Home Based Workers (3016) Pin
maliksp11-Jul-09 1:35
maliksp11-Jul-09 1:35 
AnswerAdvertisment Pin
Eddy Vluggen11-Jul-09 3:53
professionalEddy Vluggen11-Jul-09 3:53 
QuestionHow do you handle computed colums when using bulk copy? Pin
jay.net200511-Jul-09 0:54
jay.net200511-Jul-09 0:54 
AnswerRe: How do you handle computed colums when using bulk copy? Pin
Vimalsoft(Pty) Ltd14-Jul-09 20:34
professionalVimalsoft(Pty) Ltd14-Jul-09 20:34 
QuestionIntellisense not showing up in sqlserver 2008 Pin
Krishna Aditya10-Jul-09 3:59
Krishna Aditya10-Jul-09 3:59 
AnswerRe: Intellisense not showing up in sqlserver 2008 Pin
Manas Bhardwaj17-Jul-09 4:51
professionalManas Bhardwaj17-Jul-09 4:51 
GeneralRe: Intellisense not showing up in sqlserver 2008 Pin
Krishna Aditya19-Jul-09 20:38
Krishna Aditya19-Jul-09 20:38 
QuestionHow to Filter variables for SP, to return only one value from many in SQL View Pin
Krishna Aditya9-Jul-09 2:00
Krishna Aditya9-Jul-09 2:00 
Hi ,

In a SQL View, I have 5 boolean variables and one int variable.
out of 5 boolean variables only one variable will be true for a single data row,

Task                              Type      boolVerySmall Datestart                           TagName
----------------------------------------------------------------------------------
Architecture Setup -- Doc Code True               1900-01-01 00:00:00.000      Design_09

idProject   boolsmall   boolMedium   boolLarge      boolVeryLarge      intHours
----------------------------------------------------------------------------
4               False            False         False            False                  0

The above data is for one row... in this row, when I download the data from database to excel sheet, I have to display only the value which is true (boolVerySmall ,boolsmall,   boolMedium,boolLarge, boolVeryLarge, intHours) should be displayed in a s ingle column,

I have written a Stored procedure for this. I am finding it difficult to get a particular row which has TRUE of intHours>0.

I am adding the sql query below. Please help me

> SELECT      dbo.tblResourceTaskList.txtTask, dbo.tblIndividualRelativeData.txtProductType, dbo.tblResourceTaskList.boolVerySmall,
dbo.tblResourceTaskList.dtActualCompletionDate, dbo.tblEffortCodes.txtTagName, dbo.tblResourceTaskList.txtTaskNotes, dbo.tblResourceTaskList.idSubProject, dbo.tblResourceTaskList.idLaunch, dbo.tblResourceTaskList.idResource, dbo.tblResourceTaskList.boolSmall, dbo.tblResourceTaskList.boolMedium, dbo.tblResourceTaskList.boolLarge, dbo.tblResourceTaskList.boolVeryLarge,
dbo.tblResourceTaskList.intDirectHours

FROM            dbo.tblResourceTaskList INNER JOIN dbo.tblProjectUsers ON dbo.tblResourceTaskList.idSubProject = dbo.tblProjectUsers.idSubProject AND
dbo.tblResourceTaskList.idResource = dbo.tblProjectUsers.idUser INNER JOIN
dbo.tblLaunchInfo ON dbo.tblResourceTaskList.idLaunch = dbo.tblLaunchInfo.idLaunch INNER JOIN dbo.tblIndividualRelativeData ON dbo.tblResourceTaskList.idIndividualRelativeEffort = dbo.tblIndividualRelativeData.idIndividualRelativeEffort LEFT OUTER JOINdbo.tblEffortCodes ON dbo.tblResourceTaskList.idEffortCode = dbo.tblEffortCodes.idEffortCode


My stored procedure is
SELECT txtTask, txtProductType, **boolVerySmall**, txtTagName, txtTaskNotes,
                                               
dtActualCompletionDate
   FROM tblResourceTaskList_View
WHERE (idSubProject = @idSubProjectIndex )

as the first row from db has TRUE for boolVerySmall, then SP should return this value and if its other than that it should give that value.

Instead of filling *True* in excel sheet, I , have to assign VS for boolVerySmall, S - Small, M - Medium, L - Large VL- VeryLarge in the excelsheet.

So please help me how to work on this.
1. Assigning shortnames (like VS... for the bool var's).
2. Returning only one value (boolverysmall or ... ) and assigning VS to that and fill it in excel.
3. if all the bools are false, then intHours should be assinged...

Kindly help me.

Thanks
Ramm
AnswerRe: How to Filter variables for SP, to return only one value from many in SQL View Pin
Mycroft Holmes9-Jul-09 11:36
professionalMycroft Holmes9-Jul-09 11:36 
GeneralRe: How to Filter variables for SP, to return only one value from many in SQL View Pin
Krishna Aditya10-Jul-09 2:16
Krishna Aditya10-Jul-09 2:16 
GeneralRe: How to Filter variables for SP, to return only one value from many in SQL View Pin
Blue_Boy10-Jul-09 3:33
Blue_Boy10-Jul-09 3:33 
QuestionStored Proc Optimisation Pin
Paul Unsworth8-Jul-09 23:19
Paul Unsworth8-Jul-09 23:19 
AnswerRe: Stored Proc Optimisation Pin
www.Developerof.NET9-Jul-09 0:17
www.Developerof.NET9-Jul-09 0:17 
GeneralRe: Stored Proc Optimisation Pin
Paul Unsworth9-Jul-09 0:21
Paul Unsworth9-Jul-09 0:21 
AnswerRe: Stored Proc Optimisation Pin
J4amieC9-Jul-09 0:51
J4amieC9-Jul-09 0:51 
GeneralRe: Stored Proc Optimisation Pin
Paul Unsworth9-Jul-09 22:07
Paul Unsworth9-Jul-09 22:07 
AnswerRe: Stored Proc Optimisation Pin
Jeremy Likness9-Jul-09 8:31
professionalJeremy Likness9-Jul-09 8:31 
GeneralRe: Stored Proc Optimisation Pin
J4amieC9-Jul-09 23:45
J4amieC9-Jul-09 23:45 
QuestionQuering Nested Data in a table Pin
24891288-Jul-09 22:36
24891288-Jul-09 22:36 
AnswerRe: Quering Nested Data in a table Pin
Mycroft Holmes9-Jul-09 1:45
professionalMycroft Holmes9-Jul-09 1:45 
GeneralRe: Quering Nested Data in a table Pin
David Skelly9-Jul-09 2:16
David Skelly9-Jul-09 2:16 
GeneralRe: Quering Nested Data in a table Pin
Mycroft Holmes9-Jul-09 11:26
professionalMycroft Holmes9-Jul-09 11:26 
AnswerRe: Quering Nested Data in a table Pin
Niladri_Biswas9-Jul-09 5:42
Niladri_Biswas9-Jul-09 5:42 
AnswerRe: Quering Nested Data in a table Pin
Henry Minute9-Jul-09 11:17
Henry Minute9-Jul-09 11:17 
AnswerRe: Quering Nested Data in a table Pin
hemant.kaushal10-Jul-09 3:05
hemant.kaushal10-Jul-09 3:05 

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.