Answers for "how to delete all table in sql"

SQL
2

delete all rows from table sql

-- Quick, no possible rollback
TRUNCATE TABLE my_table;
-- With rollback
DELETE FROM my_table;
COMMIT;
Posted by: Guest on January-23-2021
0

sql drop all tables

DECLARE @sql NVARCHAR(max)=''

SELECT @sql += ' Drop table ' + QUOTENAME(TABLE_SCHEMA) + '.'+ QUOTENAME(TABLE_NAME) + '; '
FROM   INFORMATION_SCHEMA.TABLES
WHERE  TABLE_TYPE = 'BASE TABLE'

Exec Sp_executesql @sql
Posted by: Guest on October-18-2021

Code answers related to "how to delete all table in sql"

Code answers related to "SQL"

Browse Popular Code Answers by Language