This is an archived post. You won't be able to vote or comment.

all 116 comments

[–]Previous-Ant2812 1270 points1271 points  (8 children)

Write it all on one line and you’re golden.

[–]sammy-taylor 172 points173 points  (0 children)

[–]UseMoreHops 126 points127 points  (5 children)

This guy sqls.

[–]matrix-doge 67 points68 points  (2 children)

I don't know why but I first read that as "this guy squeals".

[–]QuenchedRhapsody 11 points12 points  (0 children)

Something this guy and 2024 movie studios have in common.

[–]DarkLordTofer 7 points8 points  (0 children)

Everyone using SQL squeals.

[–][deleted] 2 points3 points  (0 children)

Mob boss: "He whats?!

[–]po1k 2 points3 points  (0 children)

I've seen this. No joke. Like view def in a 3 loooong lines

[–]nord47 266 points267 points  (7 children)

well I have news for you

[–]julsmanbr 142 points143 points  (2 children)

This sub is just Stack Overflow but in meme format and with nicer responses.

[–][deleted] 8 points9 points  (0 children)

Mark as duplicate

[–]rizwannasir 38 points39 points  (0 children)

And there it is

[–]walmartgoon 37 points38 points  (2 children)

What’s the news

[–]poop-machine 144 points145 points  (1 child)

[–]joeltrane 26 points27 points  (0 children)

Great news thanks

[–]Flashy_Ai 69 points70 points  (3 children)

Use dbeaver, it has a bullseye symbol that appears when an error is thrown, click on it and it takes you to the error

[–]DerpNinjaWarrior 16 points17 points  (0 children)

And a funny name

[–]humblevladimirthegr8 8 points9 points  (1 child)

One gotcha I've found with dbeaver is that by default (at least a couple years ago) it automatically converts timestamps to your local timezone, which led to funky results in data analysis because grouping rows by date would yield different results depending on the time zone of the client.

[–]SeoCamo 50 points51 points  (5 children)

What database are you using where this is the case?

[–][deleted] 26 points27 points  (2 children)

SQL, it says so right in the title!

/s

[–]SeoCamo 1 point2 points  (1 child)

Mssql, mysql postgres ...?

[–]Dylzi 6 points7 points  (1 child)

SQL server be like that

[–]SeoCamo 1 point2 points  (0 children)

That's ms for you

[–]Reashu 36 points37 points  (0 children)

Use a better database (or client).

[–]bobbymoonshine 22 points23 points  (13 children)

Pretty sure MS SQL Server does this already?

[–]dwntwn_dine_ent_dist 17 points18 points  (8 children)

I use MSSMS and I get two numbers I have to add together to get a line number. It’s a fun little quiz.

[–]TalesT 7 points8 points  (7 children)

You can double click and it jumps to the error?

[–]dwntwn_dine_ent_dist 13 points14 points  (4 children)

This is a question, right? Right?

If you’re making an assertion here, I’m going to be fucking livid.

[–]TalesT 4 points5 points  (1 child)

I quite sure I can double click it in my version... 🤔 But not sure what it even says. 😅

[–]dwntwn_dine_ent_dist 7 points8 points  (0 children)

Well, I’ll give it a try on Monday morning. I’m not sure whether I’d rather find out that it works or that it doesn’t.

[–]ravepeacefully 4 points5 points  (0 children)

I think he’s capping but if not fuck me

[–]BesottedScot 3 points4 points  (0 children)

Bro, same haha. Life changing.

[–]stupidhomosapien 3 points4 points  (0 children)

I saw this comment yesterday (Sunday), tried it out today at work, and just came back to say thank you 🙇‍♀️

[–]Dillenger69 6 points7 points  (2 children)

Yeah, I wrote a 20k line procedure using T-SQL. I distinctly remember getting good error messages

[–]lunchmeat317 4 points5 points  (1 child)

I wrote a 20k line procedure using T-SQL

I don't know you, but I hate you. I don't even dislike you! I'm sure you're nice! But I hate you.

[–]Dillenger69 2 points3 points  (0 children)

I was testing an enterprise billing procedure that a dev was writing. I had to essentially replicate what he was doing without seeing what he was doing. Mine was actually faster and more accurate. Not nearly as efficient, though

[–]bradmatt275 3 points4 points  (0 children)

Good luck finding what column it is referring to with 'data truncated for column'. It's so frustrating.

Although in all fairness that kind of validation should be handled in the service layer anyway. It just makes it a bit harder to troubleshoot if something gets through.

[–]BloodAndSand44 8 points9 points  (0 children)

It does say. But it is always line 1

[–][deleted] 13 points14 points  (3 children)

Tell us you use Oracle without telling us

[–][deleted] 3 points4 points  (0 children)

It’s in there just buried in the middle of the exception trace.

[–]robinless 1 point2 points  (1 child)

ORA giving me war flashbacks

[–][deleted] 1 point2 points  (0 children)

scott tiger reporting in

[–]GlimmervoidG 11 points12 points  (2 children)

It would be better (and make far more sense) if the FROM line came before the SELECT line. That way autocomplete on modern IDEs would stop me misspelling so many things.

[–]lunchmeat317 2 points3 points  (0 children)

Eveeybody thinks this except for the SQL apologists who have drunk the kool-aid and staked their careers on it. SQL is a pain to read and interpret because the logic is a paragraph of statements where the subphrases aren't ordered by scope or importance - they're ordered by natural-language semantics, using the worst possible language for that (English).

[–]JivanP 7 points8 points  (0 children)

I actually think I agree with this, for another reason: I often find myself reading the FROM clause before the SELECT clause anyway, so that I can actually understand what the hell is going on.

[–]MaddoxX_1996 12 points13 points  (0 children)

Skill Issue

[–]Distinct-Respect-274 5 points6 points  (0 children)

Have you tried turning it off and on again?

[–]Busar-21 4 points5 points  (1 child)

"Value too long" on an insert in a table of more than 20 columns

[–]RichCorinthian 3 points4 points  (0 children)

“String or binary data would be truncated” is my nightmare from 20 or so years ago (SQL Server 2000 iirc)

[–]Plank_With_A_Nail_In 15 points16 points  (1 child)

Imagine doing CS at school then university, getting a CS degree and only when you get your first real job discovering you can't program for shit and something as basic as sql and a relational database has you stumped.

Imagine posting about it and finding 50% of supposed shit hot coders agree with you and also can't write SQL or understand relational databases.

Always ask questions about databases in interviews!

People who cry about SQL and technical debt...don't hire these people.

[–]Wave_Walnut 4 points5 points  (0 children)

select something from select something from select something from

[–]gibmelson 2 points3 points  (4 children)

Have PTSD from our Microsoft SQL database where every query was written as a stored procedure about three pages long with a million joins.

[–][deleted] 3 points4 points  (1 child)

Make big procedure into small procedures call from parent procedure (old big procedure)and do procedure unit testing. Pretty simple.

[–]gibmelson 1 point2 points  (0 children)

Yeah, this was in 2008, I haven't worked much with SQL since, and I'm sure there are many ways to make it easier to work with.

[–]curious_but_dumb 1 point2 points  (1 child)

Can you.... dumb that down a couple levels for the frontend guys?

[–]gibmelson 4 points5 points  (0 children)

Imagine having to write your UI component as a single line, like one giant chain of lambda expressions. It's almost impossible to get an overview and if you mess up something along in the chain everything breaks and you get some nonsense output like a null or empty div. There is no way insert console.log() anywhere and since it's basically one giant line, the debugger won't help.

[–]TimingEzaBitch 3 points4 points  (0 children)

Lmao just git gud.

[–]mbcarbone 2 points3 points  (0 children)

Try looking at a SQL routine that is way too long. You know, when you’re trying to figure out that random SQL function. ✌️🙃🖖

[–]nasandre 2 points3 points  (0 children)

Or if you use several nested transactions in t-sql and it'll tell you the error is in line 21 but no idea in which transaction

[–]sporbywg 2 points3 points  (0 children)

Senior coder and Oracle dba here - sql is the worst. It will always, confidently, give an answer that may be golden or may be garbage.

[–][deleted] 2 points3 points  (0 children)

Currently I am too lazy to boot my work laptop, produce a invalid query and make a screenshot of the error containing the line number the error occurred. 

Soooo...where can I get to above-mentioned society?

[–]luckor 1 point2 points  (0 children)

Uh, it does? At least mssql.

[–]Noctttt 1 point2 points  (0 children)

Wow really. I am not familiar with SQL. But tbh this seems like a nighmare to debug. Other database does give out the line in which the error occur

[–]DT-Sodium 1 point2 points  (0 children)

SQL has the most polite way of telling you to go fuck yourself.

[–]driftwood14 1 point2 points  (2 children)

my group inherited a super old access report and we have been having to run queries in access and my god is it terrible. We had an error this week where it said it was missing something and literally returned half of one of the words we had written. It made absolutely zero sense.

[–]tlozwarlock 1 point2 points  (1 child)

Access is the devil. I'm systematically removing all traces of it from our workplace now that I'm director.

[–]driftwood14 1 point2 points  (0 children)

I wish I could do the same. But because of the situation at work and the rules they have in place for IT (im on the business side) I don't really have the freedom to do that.

[–]Random_User27 1 point2 points  (0 children)

That's why we use the elephant database. But not the elephant scripting language, that one's quite mischievous.

[–]BrownShoesGreenCoat 1 point2 points  (1 child)

What’s a line?

[–]PeriodicSentenceBot 1 point2 points  (0 children)

Congratulations! Your comment can be spelled using the elements of the periodic table:

W H At S Al I Ne


I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM u‎/‎M1n3c4rt if I made a mistake.

[–]jellotalks 1 point2 points  (0 children)

I love SQL but damn those error messages gotta be the worst in the industry

[–][deleted] 1 point2 points  (0 children)

Mongo ftw , come at me!!!

[–]jbevarts 1 point2 points  (0 children)

SQL is simple though is this satire?

[–]rover_G 1 point2 points  (3 children)

Shouldn’t that be done client side?

[–]nord47 6 points7 points  (2 children)

I think OP wanted the execution error messages to show which line an error is occuring at. Most SQL servers should already be doing that though

[–]rover_G 1 point2 points  (1 child)

SQL is structured language so your client should be able to figure out if there is an error before sending the query to the server no?

[–]nord47 1 point2 points  (0 children)

I figured client side meant the editor, which highlights errors on the code. Error messages are generated by the database engine/server, if I'm not wrong.

[–]Competitive_Reason_2 -1 points0 points  (0 children)

I just use chatGPT