Questions tagged [drop-table]

The SQL command for deleting an entire table.

DROP TABLE is used in SQL to remove a table.

152 questions
2
votes
1 answer

Postgres: dropping huge AWS hosted table doesn't free up space

I have a postgres (v10) database hosted on an Amazon AWS instance (which was running very low on 'Free Storage Space'). It had a 50GB table on it which I then dropped (pgAdmin - right click, delete/drop table). I then checked the monitoring page on…
Theo F
  • 1,197
  • 1
  • 11
  • 18
2
votes
0 answers

When adding column, I have to create and drop instead of alter?

I'm trying to add a column to the end of a table in SQL like so: Open Design view Add column Generate and copy script Run, then save script For some reason, when my colleagues do this, it generates the usual ALTER TABLE script. When I attempt…
Jessica
  • 1,621
  • 2
  • 18
  • 34
2
votes
0 answers

Slow drop table on mysql 5.7 (percona)

There is a innodb-table with a size of 10 GB (1,31 GB - Data, 8,5 GB - Indexes). When I start drop table, process is performed 120 seconds, less than 200 seconds. What is the reason for the slow removal of the table? Or push it in the right…
2
votes
2 answers

PG::DependentObjectsStillExist: ERROR: cannot drop table reports because other objects depend on it

to give a bit of background. I’m a newbie in Ruby on Rails and I’m making a review website where users can report a review. I played around with having a ‘reportable’ polymorphic association and then reports table. Later I deleted the ‘reports’…
F A
  • 326
  • 2
  • 12
2
votes
2 answers

Oracle 12c - drop table and all associated partitions

I created table t1 in Oracle 12c. Table has data and it is partitioned on list partition and also has subpartitions. Now I want to delete whole table and all associated partitions (and subpartitions). Is this the right command to delete all? DROP…
Joe
  • 11,983
  • 31
  • 109
  • 183
2
votes
1 answer

why can't i delete this SQL Server table

Possible Duplicate: How to find foreign key dependencies in SQL Server? i am trying to delete a table in SQL server mgmt studio by rightclicking and clicking "DELETE". I am getting this error: Could not drop object 'dbo.Team' because it is…
leora
  • 188,729
  • 360
  • 878
  • 1,366
2
votes
1 answer

Hadoop - timed out when dropping a Hive table

I get an error when trying to drop a table in hive: > drop table my_table; Error: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. org.apache.thrift.transport.TTransportException: …
Alg_D
  • 2,242
  • 6
  • 31
  • 63
2
votes
1 answer

How to delete all tables with prefix "bkp" from a given database?

I have a SQL server 2005. In that server I have 3 databases -> a,b,c. If I want to delete tables Tables only from database "c". The table's name should start with "bkp" Table should be created one day before.
Relativity
  • 6,690
  • 22
  • 78
  • 128
2
votes
1 answer

Delete tables having exactly 10 rows in MySQL

Is it possible to delete tables with 10 records in a single statement using a statement like this? .. DROP TABLE ... WHERE name IN (SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'my_db' AND table_rows = 10);
user965748
  • 2,227
  • 4
  • 22
  • 30
2
votes
1 answer

Wordpress: Restoring a theme to it's default settings

So I installed the "twenty fourteen" theme for my Wordpress website, and I want to change it to it's deault settings. With this I mean resetting the theme to how it was when first installed (with no modifications). Currently I have checked the…
Leoking938
  • 71
  • 1
  • 2
  • 11
2
votes
1 answer

What could cause my SQL Server permissions to change from one execution of a stored procedure to the next?

I am using a stored procedure that on first execution runs without complaining about permissions. The stored procedure has only one UID/PWD set up (there are not different sets of UIDs/PWDs for granting different permission levels). The single pair…
2
votes
3 answers

Hive: DROP TABLE IF EXISTS does not free memory
When I am using DROP TABLE IF EXISTS
in hive, it is not freeing the memory. The files are created as 0000_n.bz2 and they are still on disk. I have two questions here: 1) Will these files keep on growing for each and every insert? 2)…
Naga Vemprala
  • 718
  • 3
  • 16
  • 38
2
votes
2 answers

Table is referenced by a constraint in table SYS_REF_SYS_FK_272_275 table: STAFF2 in statement [drop table STAFF]

I have 2 tables in a project that uses HSQLDB, they are called Staff and Staff2. Staff has Id PRIMARY KEY, as written here: s.execute("CREATE TABLE Staff(Id varchar(10) PRIMARY KEY, FirstName varchar(30), LastName varchar(30), Department…
Achi Even-dar
  • 427
  • 1
  • 10
  • 20
2
votes
2 answers

Dropping Temporary Tables in SQL Developer

I'm using SQL Developer and am working with Global Temporary Tables. The problem is that the temporary tables are not fully dropping when I end a session. Upon opening a new session all the "temporary" tables are listed under my schema (they don't…
jo112358
  • 55
  • 1
  • 5
2
votes
1 answer

MySQL Version 5.5.37: Dropping tables older than 30 days using CURSOR

I've been researching trying to find a way to fetch all rows from a query result and process them individually. I've written a script which I thought would work but apparently not. The script: DECLARE @name char(20); DECLARE c1 CURSOR…
Linus
  • 1,516
  • 17
  • 35