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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-11-22 : 07:45:35
|
| David writes "Hello SQL Team.I have a table that holds multiple choice questions for an examination application.i.e columns as suchquestionABCDAt present I extract a set of questions and use ASP(vbscript) toreorder the answers A,B,C,D so that each time they are presented to the end user the answers are in a different order.I thought it would be more efficient to do this extra processing on the sql server instead of the Web Server.Basically what I'm trying to acheive through SQL is to select 50 questions from my table that would follow this sort of patternfirst test - select question,a,b,c,dsecond test -select question,d,c,b,athird test - select,c,a,d,bI thought of using a UDF and dynamic SQL to change the select statement each time - not sureHope someone can helpCheersDavid..................................." |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-22 : 07:53:01
|
| Just use this querySelect a,b,c,d from yourTableThen in your ASP Page, according to test values, show the records in the specified formatfirst test - rs("a"),rs("b"),rs("c"),rs("d")second test rs("d"),rs("c"),rs("b"),rs("a")etcMadhivananFailing to plan is Planning to fail |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2005-11-22 : 09:56:17
|
| Have a look at the "order by NEWID()" phrase to see if it solves what you seem to need...ie random presentation of questions....going sideways instead of down is just a presentation issue and can be tackled as a seperate matter. |
 |
|
|
|
|
|
|
|