ahmed salah

ahmed salah

  • 1.1k
  • 629
  • 40.2k

which command will using to delete all rows from table truncate or del

Apr 27 2022 2:55 PM

I work on sql server 2017 

i need to delete all rows from table student_course 

but i don't know use 

delete from student_course

or

truncate table student_course

table student_course

studentid pk

courseid pk

table student table

studentid pk

table courses

courseid pk

---------------------------------------------

  student_course table have relation with courses table and student table

so which command will be used to delete all rows from table student_course

truncate or delete ?


Answers (4)