Truncate Statement
Truncate statement clears all the data from a table without any condition.you can not use WHERE clause with truncate command.
Syntax of Truncate
TRUNCATE TABLE [Table_Name]
Now we'll learn here. how to truncate a table step by step.
step1. Create a table.
CREATE TABLE [dbo].[Employee1](
[Id] [int]NULL,
[Name] [varchar](50) NULL,
[salary] [varchar](60) NULL,
[Gender] [varchar](10) NULL
)
step2. Set identity and primary key on ID column.
step3. Insert records into the table.
Step4. Execute the
select statement
No comments :
Post a Comment