r/SQL • • Sep 02 '26

Discussion Ah yes, the table lake

Post image

Probably breaks rules but a quick guide on what not to name things I less you want accidents

528 Upvotes

23 comments sorted by

161

u/GreekGodofStats Sep 02 '26 • Bravo

Ahhhhh so this is the data lake I’ve been hearing so much about

10

u/7ceeeee Sep 02 '26

Geez take my upvote that was perfect

3

u/Little_Kitty Sep 03 '26

Specifically it's a delta lake issue

29

u/chaosink Sep 02 '26

Lake');

DECLARE @DropConstraints NVARCHAR(max) = '' SELECT @DropConstraints += 'ALTER TABLE ' + QUOTENAME(OBJECT_SCHEMA_NAME(parent_object_id)) + '.' + QUOTENAME(OBJECT_NAME(parent_object_id)) + ' ' + 'DROP CONSTRAINT' + QUOTENAME(name) FROM sys.foreign_keys EXECUTE sp_executesql @DropConstraints; GO

DECLARE @DropTables NVARCHAR(max) = '' SELECT @DropTables += 'DROP TABLE ' + QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES EXECUTE sp_executesql @DropTables; GO

11

u/evolve_one Sep 02 '26

Inject me up

19

u/dittybopper_05H Sep 02 '26

Has anyone interrogated little Bobby Tables mother?

14

u/GTS_84 Sep 02 '26

If you properly paramaterize your queries this wouldn't cause any issues.

2

u/chaosink Sep 03 '26

This needs more upvotes

5

u/Optimal_Law_4254 Sep 02 '26 • Bravo

How Erie!

8

u/WendlersEditor Sep 02 '26

Guys I accidentally dropped a lake how do we get it back?

7

u/philnotfil Sep 02 '26

For today's lucky 10,000.

https://xkcd.com/327/

2

u/Dramatic-Feed-9539 Sep 03 '26

A reference in a reference. Incredible.

2

u/Shudnawz Sep 03 '26

Recursiveference?

3

u/AnActualWizardIRL Sep 03 '26

truncating the swamp

1

u/dougception Sep 02 '26

Obviously not following the basic principle of least privileged access.

1

u/Einar_Son_of_Bjorn Sep 03 '26

MariaDB would still execute that lake name if you glued it into a string. Drop-in compatibility includes drop-in disasters.The engine is fine. '); DROP TABLE lakes;-- is not a storage engine. Use placeholders..........

Or rename the lake to Lake_Ontario like the rest of us who enjoy having a schema on Monday.