Click here to Skip to main content
16,004,828 members
Home / Discussions / Database
   

Database

 
AnswerRe: select top 50 Pin
Muhammad Javed Khan20-Jan-06 18:41
Muhammad Javed Khan20-Jan-06 18:41 
QuestionSelect Pin
niceguyeddie199920-Jan-06 6:53
niceguyeddie199920-Jan-06 6:53 
AnswerRe: Select Pin
Mike Ellison20-Jan-06 7:43
Mike Ellison20-Jan-06 7:43 
QuestionUse of Sql Server 2005 xml query() Pin
Rob Philpott20-Jan-06 5:31
Rob Philpott20-Jan-06 5:31 
AnswerRe: Use of Sql Server 2005 xml query() Pin
Dave Kreskowiak20-Jan-06 6:55
mveDave Kreskowiak20-Jan-06 6:55 
GeneralRe: Use of Sql Server 2005 xml query() Pin
Rob Philpott23-Jan-06 5:55
Rob Philpott23-Jan-06 5:55 
Question@@FETCH_STATUS Pin
sroberts8220-Jan-06 4:04
sroberts8220-Jan-06 4:04 
AnswerRe: @@FETCH_STATUS Pin
Dave Kreskowiak20-Jan-06 4:37
mveDave Kreskowiak20-Jan-06 4:37 
Let's see the code. It sounds like you haven't "primed the pump" so to speak. The way to do it is to setup your cursor, read the first record, THEN enter the loop controled by @@FETCH_STATUS. Something like this:
    DECLARE curMasterGames CURSOR FOR
    SELECT MasterGameID FROM MasterGames
 
    OPEN curMasterGames
    DECLARE @GameID bigint
 
    -- Prime the pump.
    FETCH NEXT FROM curMasterGames INTO @GameID
    -- Check to see if the FETCH failed on the first record BEFORE we try
    -- to do any processing on that records data.
    WHILE @@FETCH_STATUS = 0
        BEGIN
            -- It seems the FETCH worked, do something with it.
            EXEC UpdatePlayerScoresOnMasterGameID @GameID
            -- Get the next record.
            FETCH NEXT FROM curMasterGames INTO @GameID
        END
    CLOSE curMasterGames
    DEALLOCATE curMasterGames
 
    -- Do the same exact pattern for the next cursor you open.
    -- Prime, test for failure, then process your loop.



RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome


-- modified at 10:37 Friday 20th January, 2006
GeneralRe: @@FETCH_STATUS Pin
sroberts8220-Jan-06 4:43
sroberts8220-Jan-06 4:43 
GeneralRe: @@FETCH_STATUS Pin
Mike Ellison20-Jan-06 7:46
Mike Ellison20-Jan-06 7:46 
GeneralRe: @@FETCH_STATUS Pin
Dave Kreskowiak20-Jan-06 8:01
mveDave Kreskowiak20-Jan-06 8:01 
GeneralRe: @@FETCH_STATUS Pin
Mike Ellison20-Jan-06 8:03
Mike Ellison20-Jan-06 8:03 
Questiongetting the size of an image from DB Pin
minkinin19-Jan-06 19:35
minkinin19-Jan-06 19:35 
AnswerRe: getting the size of an image from DB Pin
Kedar Potdar19-Jan-06 22:38
Kedar Potdar19-Jan-06 22:38 
AnswerRe: getting the size of an image from DB Pin
turbochimp21-Jan-06 20:47
turbochimp21-Jan-06 20:47 
GeneralRe: getting the size of an image from DB Pin
minkinin23-Jan-06 21:47
minkinin23-Jan-06 21:47 
QuestionImport data from Excel Pin
thainam19-Jan-06 15:48
thainam19-Jan-06 15:48 
AnswerRe: Import data from Excel Pin
Mike Ellison19-Jan-06 18:30
Mike Ellison19-Jan-06 18:30 
QuestionCount Distinct Pin
Sasuko19-Jan-06 13:49
Sasuko19-Jan-06 13:49 
AnswerRe: Count Distinct Pin
Dave Kreskowiak19-Jan-06 15:03
mveDave Kreskowiak19-Jan-06 15:03 
QuestionWord document in SQL table Pin
Tom Wright19-Jan-06 11:57
Tom Wright19-Jan-06 11:57 
AnswerRe: Word document in SQL table Pin
Mike Ellison19-Jan-06 12:49
Mike Ellison19-Jan-06 12:49 
GeneralRe: Word document in SQL table Pin
Tom Wright20-Jan-06 3:56
Tom Wright20-Jan-06 3:56 
GeneralRe: Word document in SQL table Pin
Mike Ellison20-Jan-06 6:05
Mike Ellison20-Jan-06 6:05 
QuestionHow to select First Name? Pin
SIJUTHOMASP18-Jan-06 23:06
professionalSIJUTHOMASP18-Jan-06 23:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.