Click here to Skip to main content
15,887,676 members
Home / Discussions / Database
   

Database

 
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 
GeneralRe: Populate one table from another Pin
Jörgen Andersson10-Feb-15 4:23
professionalJörgen Andersson10-Feb-15 4:23 
AnswerRe: Populate one table from another Pin
Rony8910-Feb-15 17:00
Rony8910-Feb-15 17:00 
GeneralRe: Populate one table from another Pin
Corporal Agarn11-Feb-15 0:43
professionalCorporal Agarn11-Feb-15 0:43 
QuestionHow to upgrade a SQL Server Mobile database? [Solved] Pin
TMattC6-Feb-15 3:03
TMattC6-Feb-15 3:03 
AnswerRe: How to upgrade a SQL Server Mobile database? Pin
TMattC6-Feb-15 8:55
TMattC6-Feb-15 8:55 
AnswerRe: How to upgrade a SQL Server Mobile database? [Solved] Pin
TMattC8-Feb-15 20:19
TMattC8-Feb-15 20:19 
QuestionFull Text Search sqlserver Pin
samanehahmadi2-Feb-15 19:26
professionalsamanehahmadi2-Feb-15 19:26 
AnswerRe: Full Text Search sqlserver Pin
Eddy Vluggen2-Feb-15 22:35
professionalEddy Vluggen2-Feb-15 22:35 
QuestionShrink Problem After Compress Pin
en.Mahdi31-Jan-15 2:58
en.Mahdi31-Jan-15 2:58 
QuestionRe: Shrink Problem After Compress Pin
Richard MacCutchan31-Jan-15 6:15
mveRichard MacCutchan31-Jan-15 6:15 
QuestionOracle Connection User Name and Password [UPDATE] Pin
Kevin Marois30-Jan-15 11:24
professionalKevin Marois30-Jan-15 11:24 
Questionhow can i transfer data Pin
Member 1141305829-Jan-15 12:55
Member 1141305829-Jan-15 12:55 
AnswerRe: how can i transfer data Pin
Mycroft Holmes29-Jan-15 13:41
professionalMycroft Holmes29-Jan-15 13:41 
GeneralRe: how can i transfer data Pin
Member 114130581-Feb-15 5:23
Member 114130581-Feb-15 5: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.