Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

By introducing LINQ to SQL, I found myself and my .NET developer colleagues gradually moving from TSQL to C# to create queries on the database. Entity Framework made that shift almost permanent.

Now it's nearly 2 years that I use LINQ to SQL and LINQ to Entities and haven't used TSQL that much.

Yesterday, a colleague encountered a problem (he had to create a SP) and we went to help him. But we all found that our TSQL knowledge was diminished for sure, and a simple SP that seemed trivial to us 2 or 3 years ago, was a challenge to be solved yesterday.

Thus it came to my mind that while TSQL's life is attached to SQL Server, and logically as long as SQL Server lives and doesn't change it's SQL language, TSQL would also live, practically it might die, and soon very few people might know it.

Am I right? Do existence of ORMs like Entity Framework threaten TSQL's life and usability?

share|improve this question

closed as not constructive by gnat, ChrisF Jun 1 '12 at 7:25

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

COBOL is still around, I wouldn't worry much about TSQL... – Yannis Jun 1 '12 at 6:06
up vote 1 down vote accepted

The way you've phrased your question is a bit misleading, since it seems you are comparing T-SQL to LINQ to SQL (as opposed to say ANSI SQL to LINQ to SQL). While that might be a valid comparison if we are only considering object-relational mappings, LINQ to SQL definitely does not give similar capabilities to T-SQL itself.

While I agree that there are better ways to solve the ORM problem than hand-coding SPs, T-SQL is pretty much the native scripting and programming environment for SQL Server, and every major relational DB platform has its equivalent. ANSI SQL, specifically, has been around for decades, and I don't think it's going anywhere any time soon. As a data retrieval and manipulation language, it is extremely good (if a bit more verbose than we like, nowadays), and rather standardised.

Most likely, T-SQL will be less popular with application developers than in the past, but ever-present and used for performance-sensitive operations, as well as by anyone not coding applications (I don't see DBAs using LINQ to SQL to manipulate their DBs...).

share|improve this answer
You used a better concept, less popular. I exactly meant that. Existence of something does not matter, as long as it's not used. I think that ORMs make SQL languages become something like OS native commands, and most of developers won't even see it in future. Layers of abstractions would hide it. – Saeed Neamati Jun 1 '12 at 6:58
I think the number of abstractions and higher-level "languages" for database interaction that has come and gone over the years, and the fact the (ANSI) SQL is still pretty much the same since the mid-eighties is a testament to the stability and durability of SQL. So while there are more or less domain specific abstractions that are stronger, as a general purpose interface, SQL has yet to be outperformed. That is the reason it's still around and why it will be around for many years to come. – pap Jun 1 '12 at 7:18
@SaeedNeamati in that sense, I think we're more or less in agreement. As pap points out though, ORMs typically map to the SQL language, so it is ever present (similar to, say, CoffeeScript compiling to JavaScript). In this sense, the developer might still be wise to know SQL, and I think many tasks are still better performed using SPs (e.g. most ORMs do not support incrementing a column with a single call). – Daniel B Jun 1 '12 at 7:32
@pap Agreed. I also think that SQL itself is a great language for set-based manipulation (not sure what, if anything, LINQ adds to the basic feature set). I'm not that great a fan of T-SQL itself though, but I guess it's passable for what it does. – Daniel B Jun 1 '12 at 7:36

Think of SQL as the Assembly language of the DB, and ORMs and LINQ to SQL as the higher level languages. While we might not use Assembly as much as we used to in the computer stone age, it's still there behind the scenes and it serves a purpose. The same thing applies to SQL. All those abstraction levels (ORMs, LINQ ... etc) in the end generate SQL that they communicate to the DB.

So no. While there are relational DBs then SQL (and all it's other localized dialects like T-SQL and PL/SQL) are not going anywhere

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.