Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server Cursors vs typical SQL statements

Status
Not open for further replies.

tdh2

IS-IT--Management
Feb 23, 2006
4
US
Hi,

I am a newbie to SQL Server cursor. Would you please give me a simple and practical example of using SQL Server cursor and typical SQL statements (correlated sub-query or derived tables) in term of coding as well as sample of query results based on the coding?

Thank much,
tdh2


 
Check here for examples and on line. Also, don't user cursors! You can write most sql in a set based way or use a loop if you need too.

Jim
 
Can you point me to an example of a set based way, where a loop is used, or just provide some quick syntax?
 
Brian,

It may be better to post a question regarding your cursor/loop based query. Converting a cursor based query to a set based query does not usually follow any sort of step by step based approach. Post your query, and we'll see if we can help.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top