November 10th, 2003, 10:15 AM
Join Date: May 2003
Time spent in forums: 54 m 14 sec
Reputation Power: 11
cursors filling table
looking for some help on a stored procedure. here is what i have. it is supposed to insert the unique values from an existing table into a new table. should be 40, but instead it continually puts in blank values and won't stop. so here's the proc.
CREATE PROCEDURE sp_filltitletable
declare title_curs cursor for
from employee group by title
for read only
declare @actualtitle varchar(50)
fetch title_curs into @actualtitle
while @@fetch_status = 0
insert into Emp_Title (Title) values (@actualtitle)
figured it out, had the fetch in the wrong spot!
My brain cells are like a storm trooper's armor: useless
Last edited by don_sparko : November 10th, 2003 at 10:39 AM.