Questions tagged [sql-drop]

`DROP` is a keyword in sql. It is used for dropping tables, triggers, schema, procedure etc.

DROP keyword is used for dropping tables, triggers, schema, procedure etc.

Sample code:

DROP TABLE tableName;

Reference

159 questions
1
vote
4 answers

drop/truncate and rollback segment

I know that drop removes the data as well as the table structure whereas truncate retains table structure. Does drop/truncate write to roll back segment ?
user319280
  • 757
  • 1
  • 8
  • 14
1
vote
3 answers

Selectively drop many tables in Access?

I need to drop 175 of 180 tables in Access 2003 (using an Access 2000 format database). The first thing I tried was going to the table list and trying to select all, control-clicking the ones I want to keep, and choosing "Delete". However, it…
Benjamin Oakes
  • 12,262
  • 12
  • 65
  • 83
1
vote
1 answer

PhpMyAdmin No Drop Database Option + SQL Drop Commands Disabled

I have tried altering config.default.php, config.inc.php, common.inc.php, to include $cfg['AllowUserDropDatabase'] = true; none of this results in the Drop Database option tab. When I try to use SQL statements directly I get a message that they…
1
vote
1 answer

Drop tables before creating them VS 2012 DB project

I would like to drop the tables included in the database project before creating them so each time I publish the project I do a full build of those tables (as by default it seems to work as an incremental build). I've seen options to drop the tables…
Wallack
  • 782
  • 4
  • 15
1
vote
2 answers

Drop role in SQL Server database?

I am trying to drop one of the role in my SQL Server database. I dropped all the members from the role and when i tried to drop role i got this error message: Msg 15138, Level 16, State 1, Line 13 The database principal owns a schema in the…
sanjeev40084
  • 9,227
  • 18
  • 67
  • 99
1
vote
3 answers

Oracle Forced dropping of Foreign Key during purge on Interval Partitioned Tables

We have several tables which are interval partitioned by day. While working on a purge job to drop a day of partitioning, our DBA has informed us that we will have to drop all foreign keys to any table, before performing the purge. This seems like…
user2210179
  • 73
  • 1
  • 7
1
vote
2 answers

Insert data instead of drop table into mysql

I'm attempting to get a python script to insert data into a database without having it drop the table first.. I'm sure this isn't hard to do but I can't seem to get the code right.. Here is the full python script.. #!/usr/bin/python # -*- coding:…
user2782497
  • 31
  • 1
  • 7
1
vote
2 answers

Select entries which doesn't have specified key

Assume, that I have bunch of entries in a document: db.document and some of them doesn't have some key, let's say name. So we have two types of entries - with and without name. { "_id" : ObjectId("4dea81a8bd2bb0323800002d"), "fetched_at" :…
ciembor
  • 7,189
  • 13
  • 59
  • 100
1
vote
1 answer

MySQL: DROP a column with a question mark sign?

I am trying to drop a column which has a question mark sign: ALTER TABLE player DROP is_playing?; Result: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax…
marc_aragones
  • 4,344
  • 4
  • 26
  • 38
1
vote
1 answer

Drop empty tables in postgres

In my haste partition a rather large table, I created a simple sql script to create about 4,000 tables. now that things have calmed down, I can see that I have no use for most of the partitions as I have had zero inserts into them. I now want to…
yee379
  • 6,498
  • 10
  • 56
  • 101
1
vote
2 answers

How to drop user without table in oracle

How can I drop user without the table in oracle? create user andi identified by andi; alter user andi quota 10m on users; grant connect to andi; grant create table to andi; conn andi; create table mahasiswa( idmhs number(3) primary key,…
1
vote
2 answers

Procedure for dropping unique constraint

I am trying to write a procedure to drop the Unique constraints from any table quicker. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dba].[spu_drop_uq_index]')) DROP PROCEDURE…
Andrius Naruševičius
  • 8,348
  • 7
  • 49
  • 78
0
votes
1 answer

What could cause a foreign key to not be able to be dropped even when foreign_key_checks = 0?

I'm attempting to rebuild my database, but I'm unable to get past dropping any foreign keys from tables, even though I also call SET foreign_key_checks = 0; From the MySQL docs, it seems that's all that I should need to do. What else might I need to…
openback
  • 55
  • 2
  • 6
0
votes
1 answer

Drop a table column

Is the following correct? I am getting an error. data['form_id']; $query = mysql_query(" ALTER TABLE 'email_history' DROP '$form_id'; ") or die(mysql_error()); ?>
Iain Simpson
  • 441
  • 4
  • 13
  • 29
0
votes
1 answer

Renaming columns with foreign key constraints in mysql - anyway to make it easier?

This has bothered me for awhile. The way I've been renaming columns that have foreign keys thus far has been to first remove all the foreign key constraints on various tables, and their indexes... then I rename the column, then I re-add all the…
egervari
  • 22,372
  • 32
  • 121
  • 175