Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Truncating a table

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 655
    Comment on it

    TRUNCATE TABLE Statement:

    TRUNCATE Statement is used to remove all records from a table. It is a Data Definition Language (DDL) Statement as it deletes all records and only structure remains. It is similar to delete statement but without where clause as it will also deletes all records if a condition is not specified.

    Syntax:

    TRUNCATE TABLE  tablename;
    

    Example:

    TRUNCATE TABLE Employee;
    

    The above query will delete all records from Employee table. We can do the same by using the following query:

    DELETE FROM Employee;
    

    As in the above query we have not specified any condition so it will delete all records of Employee table.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: