Use an INSERT statement to add new rows to a table or view. You can also include a SELECT statement to identify that another table or view contains the data for the new row or rows.
The table name requires the domain prefix.
INSERT INTO [Domain].[Table_Name] ([Column1],[Column2],[Column3], ...)VALUES ([Value1],[Value2],[Value3], ...)
Use the UPDATE statement to change the data in a table. The UPDATE statement modifies zero or more rows of a table, depending on how many rows meet the search condition specified in the WHERE clause. You can also use an UPDATE statement to specify the values to be updated in a single row. To do this, specify the constants, host variables, expressions, DEFAULT, or NULL. Specify NULL to remove a value from a row's column (without removing the row).
Use the DELETE statement to remove entire rows from a table. The number of rows deleted depends on how many rows match the search condition specified in the WHERE statement.
The table name requires the domain prefix.
Syntax
DELETEFROM [Domain].[Table_Name] WHERE [condition]
Example
DELETEFROM [Revenue].[Customers] WHERE [CustomerName] ='Alfreds Futterkiste';
IF
Use the IF statement to execute a condition. If the condition is satisfied, then the Boolean expressions returns TRUE value. The optional ELSE keyword introduces another statement that executes when the IF condition isn't satisfied and returns FALSE value.
Syntax
IF [condition] THEN [value_if_true] ELSE [value_if_false]
Example
IF500<1000THEN'YES'ELSE'NO'
DECLARE
Use the DECLARE statement to declare a variable.
Syntax
DECLARE @variable_name variable_type;
Example
DECLARE @var varchar(50);
SET
Use the SET variable to assign a value to a variable.