เปรียบเทียบ SQL และ T-SQL (Transact-SQL)
SQL (Structured Query Language)
- Non-procedural Language
- ใช้กับ Relational Databases
- Open Source Language
- Query สำหรับ View/Manipulate Data
- DML และ DDL Operations
- Manipulate และ Control Data
- Transfer Data แบบทีละรายการ (Row by Row)
T-SQL (Transact-SQL)
- ผลิตภัณฑ์ของ Microsoft
- Procedural Language
- Proprietary (เฉพาะ SQL Server)
- Control สูงสำหรับ Developers
- Performance ดีกับ Microsoft SQL Server
- เข้าใจง่าย, ใช้งานง่าย
- Insert Multiple Rows ได้ (BULK INSERT)
- มี SELECT INTO Statement
- รองรับ NOT EXISTS กับ SELECT
- มี Functions และ Local Variables
- Transfer Data แบบ Bulk
สรุปความแตกต่างสำคัญ
| ด้าน | SQL | T-SQL |
|---|---|---|
| Paradigm | Non-procedural | Procedural |
| Vendor | Standard (ANSI/ISO) | Microsoft |
| Licensing | Open Source | Proprietary |
| Bulk Operations | ไม่รองรับโดยตรง | BULK INSERT, SELECT INTO |
| Variables/Functions | จำกัด | Local Variables, Functions |
| Best Platform | Cross-platform | Microsoft SQL Server |