{
  "id": "enwiki-001378912282",
  "slug": "transact-sql",
  "title": "Transact-SQL",
  "qid": "",
  "lead": "Transact-SQL (T-SQL) is an extension of SQL used by Microsoft SQL products and services, including Microsoft SQL Server, and by SAP Adaptive Server Enterprise (SAP ASE). Microsoft states that tools and applications communicating with a SQL Server database do so by sending T-SQL commands. SAP describes its implementation as an enhanced version of the relational database language.",
  "body": "Transact-SQL (T-SQL) is an extension of SQL used by Microsoft SQL products and services, including Microsoft SQL Server, and by SAP Adaptive Server Enterprise (SAP ASE). Microsoft states that tools and applications communicating with a SQL Server database do so by sending T-SQL commands. SAP describes its implementation as an enhanced version of the relational database language. ==History== In January 1988, Microsoft and Ashton-Tate announced Microsoft SQL Server, based on a relational database management system licensed from Sybase. Sybase Adaptive Server Enterprise was later renamed SAP Adaptive Server Enterprise. Microsoft and SAP publish separate Transact-SQL documentation for their respective database systems. ==Microsoft implementation== The features described in this section refer to Microsoft's implementation of Transact-SQL. ===Variables and control flow=== Local variables begin with an at sign ( @ ) and are declared using DECLARE . A newly declared variable has the value NULL . Values can be assigned using SET or SELECT , although Microsoft recommends SET for variable assignment. Control-flow constructs include BEGIN...END , IF...ELSE , WHILE , BREAK , CONTINUE , RETURN , GOTO , WAITFOR , THROW , and TRY...CATCH . ===Stored procedures and error handling=== Stored procedures can accept input parameters, return values through output parameters, contain statements that operate on a database, and return a status value to their caller. The TRY...CATCH construct transfers control to a CATCH block when certain execution errors occur inside its associated TRY block. ===Data modification and bulk loading=== Transact-SQL extends the DELETE statement with an additional FROM clause, allowing rows to be identified using joined table sources. Its UPDATE statement also accepts a FROM clause containing table, view, or derived-table sources used to determine which rows are updated. The BULK INSERT statement imports data from a file into a table or view. Depending on the Microsoft database product, the source can be a file accessible to the server or a file in Azure Storage. ==See also== PL/SQL PL/pgSQL SQL/PSM Tabular Data Stream ==References==",
  "categories": [
    "103168505",
    "108640867",
    "23117742",
    "23118434",
    "23603337",
    "31128809",
    "41941517"
  ],
  "license": "CC BY-SA 4.0",
  "source_uri": "https://en.wikipedia.org/w/index.php?oldid=1378912282",
  "content_hash": "",
  "created_at": null,
  "updated_at": 1791316285.0,
  "claims": [],
  "contradictions": [],
  "confidence": 0.6,
  "csl": {
    "id": "enwiki-001378912282",
    "type": "webpage",
    "title": "Transact-SQL",
    "author": [
      {
        "family": "Anticloud FZ LLE",
        "literal": "Anticloud FZ LLE"
      }
    ],
    "container-title": "encyclopegia.org",
    "publisher": "Anticloud FZ LLE",
    "publisher-place": "Dubai, United Arab Emirates",
    "URL": "https://encyclopegia.org/a/transact-sql",
    "issued": {
      "date-parts": [
        [
          2026,
          11,
          18
        ]
      ]
    },
    "accessed": {
      "date-parts": [
        [
          2026,
          11,
          18
        ]
      ]
    },
    "license": "CC BY-SA 4.0",
    "DOI": "eo1:enwiki-001378912282",
    "isBasedOn": "https://en.wikipedia.org/w/index.php?oldid=1378912282",
    "note": "Immutable snapshot enwiki-001378912282"
  }
}