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 |
|
7siva7
Starting Member
28 Posts |
Posted - 2011-11-25 : 04:43:27
|
| Hi all,i foudn this code written in oracledeclare cursor c_emp (cin_No NUMBER) is select count(*) from employee where id = cin_No;how can we do this in sql server?thanks in advacneHI |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-11-25 : 05:18:59
|
| Have a look at the examlpes in bol. Should be almost the same.Not that a cursor would be any use in this casedeclare c_emp cursor forselect cin_No NUMBER = count(*) from employee where id = @cin_No==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-11-25 : 05:21:25
|
| ORACLE procedures mostly depend on Cursors. Do not try to simulate them in SQL Server. Post what you want to getMadhivananFailing to plan is Planning to fail |
 |
|
|
7siva7
Starting Member
28 Posts |
Posted - 2011-11-27 : 23:42:03
|
| what is replacement of cursors in SQL SERVERHI |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
7siva7
Starting Member
28 Posts |
Posted - 2011-11-27 : 23:50:57
|
| How to send private message to you ?can you give me your email address?HI |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
7siva7
Starting Member
28 Posts |
Posted - 2011-11-27 : 23:55:32
|
| ............... |
 |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-11-28 : 05:36:08
|
| for this example it would maybe bedeclare @i intselect @i = count(*) from employee where id = @cin_No;==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|