r/SQL • • Aug 22 '26

SQL Server Query Length Flex

Those of you who write very long queries (100s to thousands lines of code). Does it do only one thing or it's just your query notebook where every small part does something non related?

I am curious in which cases its necessary thousands lines of codes. Explain me what does your longest query is for?

6 Upvotes

24 comments sorted by

View all comments

Show parent comment

2

u/DaOgDuneamouse Aug 24 '26

The only real measure is:

Does it give the right answer and

Can it be maintained?