Re: Cursor vs. table data type
From: Tom Moreau (tom_at_dont.spam.me.cips.ca)
Date: 07/08/04
- Next message: Joe Celko: "Re: Help With Complicated SP (for me any way)"
- Previous message: Aaron [SQL Server MVP]: "Re: remove identity column"
- In reply to: dw: "Cursor vs. table data type"
- Next in thread: dw: "Re: Cursor vs. table data type"
- Reply: dw: "Re: Cursor vs. table data type"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 8 Jul 2004 09:07:58 -0400
Cursors are extremely slow. What exactly do you need to do? Are you
looking to insert rows into a table that don't already exist?
--
Tom
---------------------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"dw" <cougarmana_NOSPAM@uncw.edu> wrote in message
news:u7e6LgOZEHA.2844@TK2MSFTNGP12.phx.gbl...
Hello, all. We need to loop through the values in one table and compare them
with values in another. Which is more efficient -- a cursor or a table data
type for the first table? For example, this is the sort of query we run,
-- from the cursor on the 1st table, we get @strCourseSection and
@strSemester
Select @intInstPIDM = a.instPIDM From dbo.tblCourseSect a
Where a.courseSection = @strCourseSection and a.semester = @strSemester
If (@intInstPIDM Is Not Null) Begin ........
-- do an insert/update on second table here
Thanks.
- Next message: Joe Celko: "Re: Help With Complicated SP (for me any way)"
- Previous message: Aaron [SQL Server MVP]: "Re: remove identity column"
- In reply to: dw: "Cursor vs. table data type"
- Next in thread: dw: "Re: Cursor vs. table data type"
- Reply: dw: "Re: Cursor vs. table data type"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|