Search
 
SCRIPT & CODE EXAMPLE
 

SQL

truncate statement in sql

/*truncate table syntax*/
/*table name is Employees*/
TRUNCATE TABLE Employees;
Comment

Truncate Table in SQL

TRUNCATE TABLE Customers;
Comment

what is truncate in sql

DELETE -
-DML COMMAND
-Delete Rows from the table one by one
-We can use where clause with Delete to delete single row
-Delete is slower than truncate
-ROLLBACK is possible with DELETE

DROP-
-DDL COMMAND
-Delete the entire structure or schema
-We can't use where clause with drop
-Drop is slower than DELETE & TRUNCATE
-ROLLBACK IS NOT POSSIBLE WITH DROP

TRUNCATE-
-DDL COMMAND
-Truncate deletes rows at a one goal
-We can't use where clause with Truncate
-Truncate faster than both DELETE & DROP
-Rollback is not possible with Truncate
Comment

truncate syntax in sql

+----+----------+-----+-----------+----------+
| ID | NAME     | AGE | ADDRESS   | SALARY   |
+----+----------+-----+-----------+----------+
|  1 | Ramesh   |  32 | Ahmedabad |  2000.00 |
|  2 | Khilan   |  25 | Delhi     |  1500.00 |
|  3 | kaushik  |  23 | Kota      |  2000.00 |
|  4 | Chaitali |  25 | Mumbai    |  6500.00 |
|  5 | Hardik   |  27 | Bhopal    |  8500.00 |
|  6 | Komal    |  22 | MP        |  4500.00 |
|  7 | Muffy    |  24 | Indore    | 10000.00 |
+----+----------+-----+-----------+----------+
Comment

sql truncate number

-- Truncate number with cast
UPDATE my_table
SET my_column = CAST(my_column AS INT)
WHERE ...;
-- or convert
UPDATE my_table
SET my_column = CONVERT(INT, my_column)
WHERE ...;
Comment

PREVIOUS NEXT
Code Example
Sql :: check records older than 10 days 
Sql :: plsql to generate all combinations of specified number of characters in string 
Sql :: SQL AND, OR and NOT Operators 
Sql :: como hacer una consulta de un registro que no esta en una tabla en mysql 
Sql :: call object contructor and call methods of object 
Sql :: faster mysql imports 
Sql :: http://challenge01.root-me.org:58036/wsasd 
Sql :: convert sql to linq query online 
Sql :: add mysql database to power bi web 
Sql :: get id if is not equal in certain table 
Sql :: sql syntax chekcer 
Sql :: SQL CHECK Constraint in Existing Table 
Sql :: dasebase_url-postgres for windows 
Sql :: sql select starts with 
Sql :: select a row include list of array with join table SQL 
Sql :: SQL Server INSERT INTO SELECT By Complete Examples - NAYCode.com 
Sql :: postgresql regular expression special characters 
Sql :: sql "List the contact methods found in the Contact table.For each contact method, list how many people chose that contact method." 
Sql :: least orders 
Sql :: VSCode SQL Server Connection error 
Sql :: mysql server on and off 
Sql :: dbms transaction tutorialspoint 
Sql :: mysql create user if not exists 
Sql :: phone number data type in sql 
Sql :: SQL Backup Only New Changes in SQL 
Sql :: sql select upcoming birthdays 
Sql :: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it (SQL: select * from `featured_categories` limit 1) 
Sql :: oracle find constraints referencing a table 
Sql :: sql multi row insert 
Sql :: pl/sql how to delete a trigger 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =