Code That Made Me Cry, #CTMMC™

95% of all code makes me cry. The other 5% are white space.

SQL Verbosity (SQL, #43 / 48)

ADD|AGGREGATE|ALL|ALTER|AND|ANY|APPLY|AS|ASC|AT|AUTHORIZATION|
AUTO_INCREMENT|BACKUP|BEFORE|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|
CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|
COMPUTE|CONNECT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|
CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|
CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|
DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|EACH|ELSE|ELSIF|END|ERRLVL|
ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FIRST|
FOLLOWING|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GENERATED|
GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|
IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LIMIT|
LINENO|LOAD|MATCHED|MEMBER|MERGE|NATIONAL|NATURAL|NEXT|NOCHECK|NOCYCLE|
NONCLUSTERED|NOT|NULL|NULLIF|NULLS|OBJECT|OF|OFF|OFFSET|OFFSETS|ON|ONLY|
OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUT|OUTER|
OVER|OVERLAPS|PARALLEL|PARALLEL_ENABLE|PARTITION|PERCENT|PIVOT|PLAN|
PRECEDING|PRECISION|PRIMARY|PRINT|PRIOR|PROC|PROCEDURE|PUBLIC|RAISERROR|
READ|READTEXT|RECONFIGURE|REFERENCES|REFERENCING|REPLACE|REPLICATION|
RESTORE|RESTRICT|RETURN|RETURNING|RETURNS|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|
ROWGUIDCOL|ROWS?|RULE|SAVE|SCHEMA|SELECT|SEQUENCE|SESSION_USER|SET|SETUSER|
SHUTDOWN|SIBLINGS|SOME|START|STATIC|STATISTICS|SYMMETRIC|SYSTEM_USER|TABLE|
TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|TYPE|
UNBOUNDED|UNION|UNIQUE|UNPIVOT|UPDATE|UPDATETEXT|USE|USER|USING|VALUES|
VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WITHIN|WRITETEXT|XML        

This is a patched extract from prettify.js's regular expression matching a subset (!) of all SQL keywords. Everytime SQL adds a new feature, new keywords are added as well. And this list doesn't even include compound 5-word keywords, such as WHEN NOT MATCHED THEN INSERT. With SQL, we're not far away from COBOL!

Source: https://code.google.com/p/google-code-prettify/

comments powered by Disqus

Submit your own Code That Made You Cry

Send us your own example of code that made you cry! Please include:

Send the above to ctmmc@datageekery.com. All accepted submissions will be licensed as CC BY-SA 3.0. Submit only code of a compatible license.

Note that we may choose not to publish some submissions if we feel they're not appropriate. We hope you understand.

Don't let your SQL code make you cry!

Use jOOQ, instead of JDBC.

jOOQ generates Java code from your database and lets you build typesafe SQL queries through its fluent API.

Don't let your SQL code make you cry! Get back in control of your SQL with jOOQ.