Sql Tutorial Class


Truncate in sql server

Truncate in sql server.


TRUNCATE keyword is used to delete records from table.


TRUNCATE keyword Syntax:

TRUNCATE TABLE table_name


TRUNCATE keyword example:



Create Table CoconutBiscuit
(
ItemId varchar(10),
Name varchar(20),
Quantity varchar(20),
Price float,
BiscuitId varchar(10)
)

Insert into CoconutBiscuit Values('1','Coconut','100','500','B001')
Insert into CoconutBiscuit Values('2','Suger','50','200','B001')
Insert into CoconutBiscuit Values('3','Weat flour','100','600','B001')
Insert into CoconutBiscuit Values('4','Jam','50','400','B001')
Insert into CoconutBiscuit Values('5','Labour','2','100','B001')
truncate table CoconutBiscuit 



TRUNCATE keyword example in video





TRUNCATE Keyword example in image
truncate in sql server

No comments:

Post a Comment