Sure. It also has stored procedures/functions/etc. But just because it has elements of imperative->procedural language doesn't mean it is a procedural language. No more than C#'s LINQ implementations mean C# is a declarative language or lambda expressions means it is a functional language.
And though I'm not of a fan of cursors, it is a legacy of a time when it was somewhat needed. And nothing about local variables/controls/etc makes T-SQL "terrible".
All of it is necessary for database maintenance, t-sql programming, etc.
Compared to a full-featured programming language? It's good for its intent, which is to provide a minimal bit of procedural scaffolding for scripts that alter the database. It is terrible as a general-purpose procedural programming language, and I've worked with too much horrifying T-SQL and PL/SQL that pushes these tools way too far out of their intended workflow.
Yes, T-SQL is predominantely a declarative language. But it includes procedural components for writing procedural scripts. And unless we're talking about maintenance scripts or deployment scripts, don't use them.
That's all you're really claiming here. That some people write shitty code. And I agree. I've spent plenty of time with almost every flavor of SQL code that was incredibly shitty.
But I don't really blame the languages that much. I blame the people who didn't understand when and where to use one language or another.
And frankly, if you're seriously going to complain about T-SQL vs other "more full featured programming languages" and then make a blanket statement about not using any procedural components on SQL flavors . . . ummm, you might be your own worst enemy here.
You just said "I would shit a brick and beat a developer" upthread.
I'm constantly frustrated that the two options in the database world appear to be "use SQL and all its anachronistic warts" or "give up on the relational model". NoSQL throws the baby out with the bath-water.
But this is a tangent. The original post came about calling T-SQL a "procedural language". Which is inaccurate... but the author was talking about adding extensions to Sqlite - SQlite is already a SQL dialect. So if you're bolting on T-SQL to Sqlite, what's the main thing it will bring to the table?
It's procedural components. So, in the context of comparing Sqlite to T-Sql, using the term "procedural language" might be a misnomer, but it makes sense here.
I can appreciate the verbosity and "backwardness" argument you make, but can you cite some examples of its restrictions. (Serious question)
Everything you are saying here sounds like a job for something other than a relational database.
I would shit a brick and beat any database developer with it that introduced the idea of a class as a primitive. Fuck that happy horse shit.
Also, graphs? Really?
You're looking for an ORM and blaming SQL for not being that.
There is no common database pattern that creates one table as a subset of another table. RDBMS is, by nature and design, not something you modify in that way on the fly. If you want that kind of object oriented functionality, push your data into a cache layer or column store or KV.
You said it yourself. Use the right tool for the right job. Nothing you've said makes even remotely any sense as a criticism of T-SQL or SQL in general. That's not the right tool for what you're talking about.
And the inability to pull down a graph as a single operation is the perfect example of sql's limitations.
Relational model is great right? Right. So why throw it out the window and give me a glorified excel spreadsheet as a result set? If I want to pull down a thing and it's related subthings in a single operation, I have to join which is wasteful in that case. This actualy hamstrings ORMs.
I wouldn't hit you with an actual brick, but if I worked with you, I'd certainly nerf dart you on a regular basis.
There are so many pain points in SQL that are defended because theory.
You might want to have a look at that as a significant enabler of code reuse on SQL Server.
(On PgSQL is LATERAL JOIN)
(Ps: you should try to replace SCALAR functions with SET-BASED logic. These can easily be ringfenced into TVF)
Use your presentation layer for displaying your data once it's actually properly processed.
I think he's referring to the terrible terrible terrible procedural components of T-SQL - cursors, local variables, IF/THEN control blocks, etc.
Right Tool For The Job. Sql is good for querying/storing data, so use it for that. Then let the C# handle manipulating the data and applying rules and whatnot.