How to delete all data in a table in SQL CE?

前端 未结 2 1139
时光取名叫无心
时光取名叫无心 2021-02-19 08:32

SQL CE does not support TRUNCATE command. To clear a table I have to use DELETE. Is there a quicker/better way to clear the data then the following command?

DELE         


        
相关标签:
2条回答
  • 2021-02-19 09:20

    You don't have any better way to do that, DELETE is the SQL Command for SQL CE to DELETE ROWS, anyway TRUNCATE TABLE deletes every row in a table, so your DELETE query must be executed also at SQL Server if you want to DELETE all the rows with id different from 'ABC'.

    In the case you want to DELETE all the rows in SQL CE you must use

    DELETE FROM FooTable
    

    See you, I hope this post was useful to you.

    0 讨论(0)
  • 2021-02-19 09:35

    No, other than DROP TABLE, CREATE TABLE and INSERT the surviving data (if there are any)

    0 讨论(0)
提交回复
热议问题