Mistři v programování na #hovnokod

Produkcni kod. A pak se divi, ze je to pomale...

-- Delete User Log
DECLARE @intIdentityLog   as Int
DECLARE curTrans CURSOR
LOCAL FORWARD_ONLY
FOR SELECT
       UserLog_intIdentity
FROM tblUser_Log
WHERE UserLog_dtmDateRec BETWEEN @DateToPurge AND @dtmRetainAfter

OPEN   curTrans
FETCH NEXT FROM curTrans
INTO   @intIdentityLog
WHILE  @@FETCH_STATUS = 0
BEGIN
       SET @Processed = 'Y'
       IF @intTestMode<> 'Y'
       BEGIN
             DELETE FROM tblUser_Log
             WHERE CURRENT OF curTrans
       END
       ELSE
       BEGIN
             PRINT 'ULOGI : ' + CAST (@intIdentityLog AS varchar(10))
       END

       FETCH NEXT FROM curTrans INTO @intIdentityLog
END

CLOSE curTrans
DEALLOCATE curTrans

Lukáš Navrátil,

Keď je databázový expert Rumun.

BEGIN 
 FOR r IN (SELECT * FROM Picture WHERE qr_frame_color IS NULL)
 LOOP
  UPDATE Picture SET qr_frame_color = '#ff0000' WHERE pic_id = r.pic_id
  COMMIT;
 END LOOP;
END;

Anonymous,

Aneb když se mi zdá, že málo vyhledávám.

SELECT village_part_description_id
FROM village_part_description_assignment
WHERE village_part_description_id = 78

Zbyněk Rybička,

Kde se konají schůzky? Nejspíš v hospodě, protože jen tam se člověk směje.

select begin as start, end, ':-)' as title from meetings

Zbyněk Rybička,

Miluji subselecty

select * from items where client_id in (select client_id from clients where client_id = 43820)

Anonymous,