Click here to Skip to main content
15,568,963 members
Home / Discussions / Database
   

Database

 
GeneralRe: vb.net with mysql Pin
KipkoechE8-Feb-15 19:56
KipkoechE8-Feb-15 19:56 
GeneralRe: vb.net with mysql Pin
PIEBALDconsult9-Feb-15 4:47
professionalPIEBALDconsult9-Feb-15 4:47 
AnswerRe: vb.net with mysql Pin
ZurdoDev9-Feb-15 5:01
professionalZurdoDev9-Feb-15 5:01 
GeneralRe: vb.net with mysql Pin
Jörgen Andersson9-Feb-15 5:09
professionalJörgen Andersson9-Feb-15 5:09 
QuestionRe: vb.net with mysql Pin
Eddy Vluggen9-Feb-15 6:53
professionalEddy Vluggen9-Feb-15 6:53 
QuestionPopulate one table from another Pin
Corporal Agarn6-Feb-15 5:50
professionalCorporal Agarn6-Feb-15 5:50 
QuestionRe: Populate one table from another Pin
Wendelius6-Feb-15 6:23
mveWendelius6-Feb-15 6:23 
AnswerRe: Populate one table from another Pin
Corporal Agarn6-Feb-15 7:49
professionalCorporal Agarn6-Feb-15 7: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 22:29
professionalJörgen Andersson9-Feb-15 22:29 
GeneralRe: Populate one table from another Pin
Corporal Agarn10-Feb-15 1:42
professionalCorporal Agarn10-Feb-15 1:42 
GeneralRe: Populate one table from another Pin
Corporal Agarn10-Feb-15 3:23
professionalCorporal Agarn10-Feb-15 3:23 
GeneralRe: Populate one table from another Pin
Jörgen Andersson10-Feb-15 5:23
professionalJörgen Andersson10-Feb-15 5:23 
AnswerRe: Populate one table from another Pin
Rony8910-Feb-15 18:00
Rony8910-Feb-15 18:00 
GeneralRe: Populate one table from another Pin
Corporal Agarn11-Feb-15 1:43
professionalCorporal Agarn11-Feb-15 1:43 
QuestionHow to upgrade a SQL Server Mobile database? [Solved] Pin
TMattC6-Feb-15 4:03
TMattC6-Feb-15 4:03 
AnswerRe: How to upgrade a SQL Server Mobile database? Pin
TMattC6-Feb-15 9:55
TMattC6-Feb-15 9:55 
AnswerRe: How to upgrade a SQL Server Mobile database? [Solved] Pin
TMattC8-Feb-15 21:19
TMattC8-Feb-15 21:19 
QuestionFull Text Search sqlserver Pin
samanehahmadi2-Feb-15 20:26
professionalsamanehahmadi2-Feb-15 20:26 
AnswerRe: Full Text Search sqlserver Pin
Eddy Vluggen2-Feb-15 23:35
professionalEddy Vluggen2-Feb-15 23:35 
QuestionShrink Problem After Compress Pin
en.Mahdi31-Jan-15 3:58
en.Mahdi31-Jan-15 3:58 
QuestionRe: Shrink Problem After Compress Pin
Richard MacCutchan31-Jan-15 7:15
mveRichard MacCutchan31-Jan-15 7:15 
QuestionOracle Connection User Name and Password [UPDATE] Pin
Kevin Marois30-Jan-15 12:24
professionalKevin Marois30-Jan-15 12:24 
Questionhow can i transfer data Pin
Member 1141305829-Jan-15 13:55
Member 1141305829-Jan-15 13:55 
AnswerRe: how can i transfer data Pin
Mycroft Holmes29-Jan-15 14:41
professionalMycroft Holmes29-Jan-15 14:41 
GeneralRe: how can i transfer data Pin
Member 114130581-Feb-15 6:23
Member 114130581-Feb-15 6: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.