Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Is this possible without iteration?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-07-06 : 11:53:20
Flinky Wisty Pomm writes "Okay, I've recently been drafted in to train a web team and I've foolishly told them that there are no problems they are likely to come up against which cannot be solved in a set-based way. I might have found one.

This is a slightly simplified form, but only just.

I have a questionnaire. Each question in my questionnaire has 0 to N answers. Questions with 0 answers do not have the "Multiple" bit set to True. Each answer has a score.

Each question can have 0 to N answers of the available set selected as part of a response.

So, question one might allow two answers (of ten) to be selected, question two might allow only one answer (of three) to be selected, question three has no preset answers at all and question four might allow N answers (of 465) to be selected.

Is there any way of retrieving the maximum possible score for a questionnaire /without/ iteration?"

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-07-06 : 11:59:08
How 'bout some sample tables and data.. and possibly a nice result set to shoot for...

I for one do not think it is incorrect to say that
quote:
there are no problems they are likely to come up against which cannot be solved in a set-based way


also, just because you use some kind of loop does not mean the solution cannot be set-based...

Corey
Go to Top of Page
   

- Advertisement -