0
  1. Is there an obvious difference between SQL and T-SQL?
  2. Which is used in a ASP.Net/C# application? or can either be used?

This might seem a bad question, but I have only recently heard the term T-SQL and wondering if there is an actual identifiable difference or is it just another fancy term to sound cool.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
SANM2009
  • 1,918
  • 2
  • 12
  • 30
  • 1
    Google would have told you that "Transact-SQL (T-SQL) is Microsoft's and Sybase's proprietary extension to the SQL..." If you're using SQL Server, you'll be using T-SQL. – Joe Jan 03 '18 at 22:04
  • Yeah I get that. But which one is used with ASP.Net applications? – SANM2009 Jan 03 '18 at 22:06
  • ASP.net can interact with many different database engines. The exact flavour of SQL you will be using is dependant on which engine you are using. – Jon P Jan 03 '18 at 22:56
  • It is all clear now. Its just that Microsoft DB is called MS SQL, which gave me the impression SQL being proprietary. it all makes sense now, SQL generic language and MYSQL, MS SQL etc use their implementations of the generic SQL language. – SANM2009 Jan 03 '18 at 23:06

2 Answers2

1

SQL is the broad term for the language

T-SQL is a procedural extension to the language SQL. It is available through Microsoft SQL Server

If you decide to use SQL Server as your DB, you get SQL and the additional functionality of T-SQL which adds a long list of things, loosely covered in the link above. T-SQL isn't just a fancy term, it does add plenty of functionality, but most of that functionality exists in other DBs through other procedural language extensions.

Yes you can use SQL Server with ASP.NET and therefore T-SQL

Aaron Dietz
  • 10,137
  • 1
  • 14
  • 26
  • Ok Thanks. So if I get this right, when using SQL database with ASP.net application the queries are written in T-SQL. – SANM2009 Jan 03 '18 at 22:28
  • When using a **Microsoft SQL Server** database (which is often used with ASP.NET), then yes. “SQL Database” is a general term. – Christian Specht Jan 03 '18 at 22:30
  • Similarly you also have PL/SQL, which is Oracle Corporation's procedural extension for SQL, you might want to read about that as well. – Pharaoh Jan 04 '18 at 08:17
  • @SANM2009 Think of SQL like the numbers 1-10, then think of T-SQL as math operators `+ - / * =`. You can count 1-10 with just numbers, but if you want to do math you need to include operators, right? T-SQL and other procedural extensions are just like math operators are to numbers, they add more options which expand the uses of the language. – Aaron Dietz Jan 04 '18 at 17:51
1

SQL is used to query databases for data

ASP.NET is for Web UI If you send native SQL commands to your database, you need to use standart ANSI SQL, but better with more functionality for the target database platform use specific SQL language created for that Data Platform.

Just a few of them,

  • Transact-SQL or T-SQL for Microsoft SQL Server
  • PL/SQL for Oracle
  • SQLScript for SAP HANA Database

Again in ASP.NET, the libraries you are using will provide objects that can be used for that database connection

Eralper
  • 6,461
  • 2
  • 21
  • 27