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 |
|
Tethys
Starting Member
3 Posts |
Posted - 2005-11-09 : 12:38:43
|
| I've searched on the posts here concerning cursors and am not finding what I'm looking for. Perhaps someone here can supply some insite.Problem:- I need to understand how to include a cursor within a 2nd select select statementExample:- Please append to this as needed, thanks:SELECT Var1, Var2, (SELECT Var4 FROM tblExample) AS Var3, Var4FROM ...WHERE ...Thanks in advance.-Tethys: Ah. I should probably add that I've successfully placed a cursor around the outermost SELECT, but when trying to mimic this on the inner SELECT, it doesn't take. |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2005-11-09 : 15:25:17
|
| You mean in a subquery.Cursors cannot be used there.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-10 : 00:39:14
|
| SELECTVar1,Var2,(SELECT Var4 FROM tblExample) AS Var3,Var4FROM ...WHERE ...will work only if SELECT Var4 FROM tblExamplereturns single rowMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|