Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 15 sie 2019 · SELECT 'DROP TABLE "' || TABLE_NAME || '";' FROM USER_TABLES WHERE TABLE_NAME LIKE 'YOURTABLEPREFIX%' Or if you want to remove the constraints and free up space as well, use this: SELECT 'DROP TABLE "' || TABLE_NAME || '" cascade constraints PURGE;' FROM USER_TABLES WHERE TABLE_NAME LIKE 'YOURTABLEPREFIX%'

  2. 23 gru 2014 · Use the INFORMATION_SCHEMA.TABLES view to get the list of tables. Generate Drop scripts in the select statement and drop it using Dynamic SQL: DECLARE @sql NVARCHAR(max)=''. SELECT @sql += ' Drop table ' + QUOTENAME(TABLE_SCHEMA) + '.'+ QUOTENAME(TABLE_NAME) + '; '. FROM INFORMATION_SCHEMA.TABLES.

  3. 29 wrz 2016 · You can build up a string using the catalog views, e.g.: DECLARE @sql NVARCHAR(MAX) = N''; SELECT @sql += '. DROP TABLE '. + QUOTENAME(s.name) + '.' + QUOTENAME(t.name) + ';'. FROM sys.tables AS t. INNER JOIN sys.schemas AS s. ON t.[schema_id] = s.[schema_id]

  4. 8 lip 2024 · In SQL Server, we can write a T-SQL (Transact-SQL) script to drop all the tables inside a schema: DECLARE @sql NVARCHAR(MAX) = ''; SELECT @sql += 'DROP TABLE ' + QUOTENAME(table_schema) + '.' + QUOTENAME(table_name) + ';' + CHAR (13) FROM information_schema.tables.

  5. 2 kwi 2021 · Solution. We’ll look at three ways to drop all tables in a database. Drop Tables from SQL Server Management Studio (SSMS) Dynamically Generate SQL to Drop Constraints and Tables Programmatically. Dynamically Generate and Execute SQL to Drop Constraints and Tables Programmatically.

  6. 23 paź 2018 · Let us create the following three tables to demonstrate dropping multiple tables using a single DROP statement. USE TempDB GO CREATE TABLE testing1(ID INT, NAME VARCHAR(100)); CREATE TABLE testing2(ID INT, NAME VARCHAR(100)); CREATE TABLE testing3(ID INT, NAME VARCHAR(100));

  7. 19 paź 2022 · SQL DROP Table for all Tables in a SQL Server Database. The solution is straightforward - list all tables in your SQL Server database, for example, in one DROP statement separated by commas. Example syntax: DROP TABLE table1, table2, table3, table4, table5;

  1. Ludzie szukają również