Come eliminare tutte le voci nella tabella sql

Esempi di codice

9
0

elimina tutti i record dalla tabella

DELETE FROM table_name;
5
0

sql elimina dove in

-- Deletes all records where `columnName` matches the values in brackets.
DELETE FROM tableName WHERE columnName IN ('val1', 'val2', 'val3');
4
0

elimina tutte le righe dalla tabella mysql

-- Quick, no possible rollback
TRUNCATE TABLE my_table;
-- With rollback
DELETE FROM my_table;
COMMIT;
3
0

come eliminare i dati di una tabella in sql

DELETE FROM table_name; //will delete the table data without affecting the table structue
0
0

Query SQL per eliminare tutte le tabelle in un database

BY LOVE

EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"
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

In altre lingue

Questa pagina è in altre lingue

Русский
..................................................................................................................
English
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................