I’m using SQL Server.
Can any one help me organize the syntax and difference between
cursor and cross apply‘ ?
Update: my intention is:
I have one user-SP_1 which gets a varchar “id” as param. I have built another user-SP_2 that gets manay “ids”, parse them and then I want to send them to user-SP_1 in a loop.
Cursors allow you to loop through data one record at a time. They are generally discouraged because they are ridiculously slow compared to set based operations, and I would venture to say that the need for them is most often caused by a poor database design. They are nonetheless necessary sometimes though.
Here is a good SO page on Cross Apply: When should I use Cross Apply over Inner Join?
I suspect that one of these two things isn’t quite what you are thinking it is though since as marc_s said they are completely different things. So let us know what you’re trying to accomplish if you need more help.