How to crop a table with SQL Server 2008?

I want to crop the table, but when the column value is NULL

 truncate table FB_Player where FB_Player.Status ='NULL' 
+6
source share
2 answers

You cannot use Where Where truncated. Truncate clears all data from a table without any conditions. Instead, you use the Delete command.

+8
source

You are looking for Delete not Truncate .

You cannot use the where clause with TRUNCATE .

You can try the following: -

 delete from FB_Player where FB_Player.Status is NULL 

From wiki

You cannot specify a WHERE clause in a TRUNCATE TABLE statement โ€” that's all or nothing.

+9
source

Source: https://habr.com/ru/post/954320/


All Articles