|
|
-
|
|
Derived tables:-
Derived tables are the tables which are created on the fly with the help of the Select statement. It is different from the temporary table in the way that in case of temporary table, first we have to create a temporary table, insert th...
|
|
-
|
|
Many times we need to alter the table definition by adding , deleting or updating a column in the table. In this article, I am trying to explain the following :-
1. How to add a column
2. How to update a column
3. How to drop a column
Suppose we have a ...
|
|
-
|
|
Pivot Table:- Pivot tables are used to summarize and display the data, specially in case of report data by means of aggregating the values. Pivot table can be used if we want to display the unique values of the column of a table as the columns of another...
|
|
-
|
|
SQL FUNCTION: -
Function in a database can be defined as the code segment consisting of a logical group of SQL statements which takes some input arguments (if required), run in a sequential order and returns the output either in the form of a single va...
|
|
-
|
|
Introduction
Triggers can be defined as the database objects which perform some action for automatic execution whenever users try to do execute data modification commands (INSERT, DELETE and UPDATE) on the specified tables. Triggers are bound to specifi...
|
|
-
|
|
Output Clause:- The SQL SERVER 2005 gives us an Output Clause which gives us the information about each row affected by the Insert, Update , Delete and Merge statement. It is more useful than @@scope_Identity and @@Identity column since these global varia...
|
|
-
|
|
Common table expression (CTE):- Common table expression or CTE can be described as the temporary, named record set return by the execution of the query (insert, delete, update, select or update view statement). It is not stored as an object in the databa...
|
|
-
|
|
Table variable:- SQL Server provides an variable known as table variable which is used to store data in a similar way as we store data in physical tables but with some limitations. Like other SQL variable, it is also declare with the help of the Declare k...
|
|
-
|
|
Local temporary table:- Local temporary table is created in the tempdb and it is visible to the current user's session only. It remains exists till the current user session is connected. Once the user connection is disconnected it gets destroyed. Since t...
|
|
-
|
|
Global temporary table:- Global temporary table is created in the tempdb and it is visible to all other sessions as well. Global temporary tables are only destroyed when the current user disconnected and all the sessions referring to it closed. It means...
|
|