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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 avoiding a cursor again

Author  Topic 

Vivaldi
Constraint Violating Yak Guru

298 Posts

Posted - 2001-10-02 : 17:14:11
hey sqler's

I have an easy query question, but I am really stupid today (or all the time).

i converted a bunch of old data into a new system, i was told a specific date was the "exit date" therefore allowing me to exit the person in my database.

Well,

I need to run updates
that essentially do this

update CaseInfo
set exitdate = NULL
, active = 'No'

where
-- pseudo sql to follow
count from EnterContract
is greater than
count from ExitContract

(for each caseinfoid)

should I just use a cursor to loop through each caseinfo record

get count from the to contract tables
then update the caseinfo table's exit data?

I am a rookie in sql,
and in dating women for that matter.


_________________________
Death is one day closer
   

- Advertisement -