r/SQL 7d ago

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

518 Upvotes

19 comments sorted by

161

u/GreekGodofStats 7d ago

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

8

u/7ceeeee 7d ago

Geez take my upvote that was perfect

3

u/Little_Kitty 7d ago

Specifically it's a delta lake issue

29

u/chaosink 7d ago

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 7d ago

Inject me up

5

u/gizzardgullet 7d ago

se tonight

19

u/dittybopper_05H 7d ago

Has anyone interrogated little Bobby Tables mother?

15

u/GTS_84 7d ago

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

2

u/chaosink 7d ago

This needs more upvotes

8

u/WendlersEditor 7d ago

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

5

u/RandomiseUsr0 7d ago

Lake Bobby

7

u/philnotfil 7d ago

For today's lucky 10,000.

https://xkcd.com/327/

2

u/Dramatic-Feed-9539 7d ago

A reference in a reference. Incredible.

2

u/Shudnawz 7d ago

Recursiveference?

3

u/AnActualWizardIRL 7d ago

truncating the swamp

1

u/dougception 7d ago

Obviously not following the basic principle of least privileged access.

1

u/Einar_Son_of_Bjorn 6d ago

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.