Click here to Skip to main content
15,897,187 members
Home / Discussions / Database
   

Database

 
GeneralRe: Triggers Pin
John C Rayan12-Feb-15 3:32
professionalJohn C Rayan12-Feb-15 3:32 
QuestionRANKING IN VB.NET MYSQL Pin
KipkoechE10-Feb-15 22:27
KipkoechE10-Feb-15 22:27 
SuggestionRe: RANKING IN VB.NET MYSQL Pin
Richard MacCutchan11-Feb-15 0:06
mveRichard MacCutchan11-Feb-15 0:06 
GeneralRe: RANKING IN VB.NET MYSQL Pin
KipkoechE11-Feb-15 1:32
KipkoechE11-Feb-15 1:32 
GeneralRe: RANKING IN VB.NET MYSQL Pin
Richard MacCutchan11-Feb-15 1:36
mveRichard MacCutchan11-Feb-15 1:36 
GeneralRe: RANKING IN VB.NET MYSQL Pin
KipkoechE11-Feb-15 1:41
KipkoechE11-Feb-15 1:41 
AnswerRe: RANKING IN VB.NET MYSQL Pin
GuyThiebaut11-Feb-15 2:11
professionalGuyThiebaut11-Feb-15 2:11 
GeneralRe: RANKING IN VB.NET MYSQL Pin
KipkoechE11-Feb-15 2:23
KipkoechE11-Feb-15 2:23 
GeneralRe: RANKING IN VB.NET MYSQL Pin
GuyThiebaut11-Feb-15 2:28
professionalGuyThiebaut11-Feb-15 2:28 
QuestionVB.NET ITEXTSHARP PDF REPORTS Pin
KipkoechE10-Feb-15 6:38
KipkoechE10-Feb-15 6:38 
QuestionMySQL for MFC application Pin
Anu_Bala10-Feb-15 0:14
Anu_Bala10-Feb-15 0:14 
AnswerRe: MySQL for MFC application Pin
Kornfeld Eliyahu Peter10-Feb-15 2:37
professionalKornfeld Eliyahu Peter10-Feb-15 2:37 
Questionvb.net with mysql Pin
KipkoechE8-Feb-15 17:04
KipkoechE8-Feb-15 17:04 
AnswerRe: vb.net with mysql Pin
PIEBALDconsult8-Feb-15 17:33
mvePIEBALDconsult8-Feb-15 17:33 
GeneralRe: vb.net with mysql Pin
KipkoechE8-Feb-15 18:56
KipkoechE8-Feb-15 18:56 
GeneralRe: vb.net with mysql Pin
PIEBALDconsult9-Feb-15 3:47
mvePIEBALDconsult9-Feb-15 3:47 
AnswerRe: vb.net with mysql Pin
ZurdoDev9-Feb-15 4:01
professionalZurdoDev9-Feb-15 4:01 
GeneralRe: vb.net with mysql Pin
Jörgen Andersson9-Feb-15 4:09
professionalJörgen Andersson9-Feb-15 4:09 
QuestionRe: vb.net with mysql Pin
Eddy Vluggen9-Feb-15 5:53
professionalEddy Vluggen9-Feb-15 5:53 
QuestionPopulate one table from another Pin
Corporal Agarn6-Feb-15 4:50
professionalCorporal Agarn6-Feb-15 4:50 
QuestionRe: Populate one table from another Pin
Wendelius6-Feb-15 5:23
mentorWendelius6-Feb-15 5:23 
AnswerRe: Populate one table from another Pin
Corporal Agarn6-Feb-15 6:49
professionalCorporal Agarn6-Feb-15 6:49 
Here is what I currently use:
SQL
DECLARE @TestID INT, @RemCount INT, @irow INT;

IF OBJECT_ID('tempdb..#UpdateAgent') IS NOT NULL DROP TABLE #UpdateAgent;
SELECT TestID, CNT AS RemCount
    ,  ROW_NUMBER() OVER(ORDER BY TestID) AS IDX
INTO #UpdateAgent
FROM #MyTestCounts;

SELECT @MIDX = MAX(IDX) FROM #UpdateAgent

WHILE @irow <= @MIDX
BEGIN
    SELECT @TestID = TestID, @RemCount = RemCount
    FROM #UpdateAgent
    WHERE IDX = @irow;

    IF @RemCount < 0 SET @RemCount = 0;

    UPDATE WQueueCheck
    SET TestID         = @TestID
    FROM #MyTestBase
    INNER JOIN (
            SELECT TOP (@RemCount) TQB.IDX
            FROM #MyTestBase TQB
            WHERE TestID IS NULL
            ORDER BY NEWID() ) X
        ON #MyTestBase.IDX = X.IDX;

    SET @irow += 1;
END


[edit] missed removing a column from production versus test
Mongo: Mongo only pawn... in game of life.


modified 6-Feb-15 13:37pm.

AnswerRe: Populate one table from another Pin
Jörgen Andersson9-Feb-15 21:29
professionalJörgen Andersson9-Feb-15 21:29 
GeneralRe: Populate one table from another Pin
Corporal Agarn10-Feb-15 0:42
professionalCorporal Agarn10-Feb-15 0:42 
GeneralRe: Populate one table from another Pin
Corporal Agarn10-Feb-15 2:23
professionalCorporal Agarn10-Feb-15 2:23 

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.