How Many Types of Table in Transact-SQL
In this article I am going to explain about how how many types of table in Transact-SQL.
Transact-SQL (T-SQL) is Structured Query Language and it is Microsoft's and Sybase's proprietary. Transact-SQL is originally developed by IBM for querying, altering and defining relational database. Transact SQL is also known as T-SQL. T-SQL supports many feature like variables, loops, conditions and exceptions.
Types of Table
There are five type of tables in Transact SQL
- Standard table
- Temporary table
- Table Variable
- Derived table
Standard tables are available within the system until explicitly deleted.
create table mcnemp
Temporary tables are available within the system while current database session is open.
SELECT TOP 1 vendorid,SUM(invoicetotal)
GROUP BY vendorid
ORDER BY inv_sum DESC
Tables variable are available within a script while current batch is executing.
DECLARE @vendorinfo TABLE
(vendorid INT, vendorname VARCHAR(40))
SELECT vendorid, vendorname
WHERE vendorid IN
Derived tables are available within a statement while current batch is executing.
View are available within a system until explicitly deleted.