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
0
votes
4 answers

sqsh SQL Server 2005 execute *.sql file

I would to drop remote SQL Server db via sqsh but, I don't know how does it works. I can connect to sql server with command: sqsh -Ulogin -Ppass -Smssql2005
Roman Iuvshin
  • 1,872
  • 10
  • 24
  • 40
0
votes
1 answer

How to create a migration deleting a table in ruby on rails

I want to delete a table in my rails app but i cannot use rollback, because i created this table a long time ago, and i have a LOT of other tables created since that one. How is supposed to be named a drop table migration file and is there a way to…
Syl
  • 3,719
  • 6
  • 35
  • 59
0
votes
1 answer

How Drop the only subpartition of a partition

While I am deleting subpartitions, one of the partition contains only one subpartition I got an error. Error: ORA-14629 cannot drop the only subpartition of a partition Can anyone know how to drop single subpartition of a partition
0
votes
1 answer

Cleaning up a table to remove votes entered within a one hour timeframe

The scenario: You've made a superb script where users can vote for images but you haven't put a failsafe on the POST meaning that some users end up finding a way to vote multiple times for an image in one go by refreshing their browser. The problem:…
James P.
  • 19,313
  • 27
  • 97
  • 155
0
votes
3 answers

What is the "god" sys table?

IF EXISTS (SELECT * FROM sys.all_objects WHERE name = N'SOMELOGIN') DROP USER [SOMELOGIN] GO Does not work because USER SOMELOGIN does not live in sys.all_objects. Is there a global "god" table I can look in to see if something exists. (i.e.…
Raynos
  • 166,823
  • 56
  • 351
  • 396
0
votes
2 answers

MySQL Drop INDEX and REPLICATION

In a MySQL MASTER MASTER scenario using InnoDB When dropping an index on one instance will the same table on the other instance be available? What is the sequence of activities? I assume the following sequence: DROP INDEX on 1st instance Added to…
Kalisen
  • 467
  • 1
  • 5
  • 13
0
votes
2 answers

Equivalent for drop table table_name cascade constraints in SQL Server

My question is that in Oracle we can use drop table table_name cascade constraints to drop a referenced table object. How can I achieve the same in SQL Server?
yayayokoho3
  • 1,209
  • 2
  • 16
  • 40
0
votes
2 answers

How do I select from a table and delete all other non-selected entries?

Is there an elegant way to delete all non-selected entries from a table after selecting from it?
Hamster
  • 2,962
  • 7
  • 27
  • 38
0
votes
1 answer

Drop all partitions from a table MySQL

How can I drop all partitions from a table in MySQL. I know you can drop specific partitions with ALTER TABLE table_name DROP PARTITION p0, p1, but is there a way to not list every single partition name?
Cirrus86
  • 336
  • 4
  • 13
0
votes
1 answer

MySQL : error 1217 on DROP TABLE. Foreign key refering on its own primary key. ON DELETE CASCADE is on

I'm trying this query DROP TABLE IF EXISTS Core; on a table created with this query CREATE TABLE Core ( id serial PRIMARY KEY, title varchar(512), kind ENUM('User', 'Organisation', 'Channel', 'Collection', 'Text', 'Picture', 'Sound',…
HellDryx
  • 5
  • 1
0
votes
2 answers

How to drop an in-memory table in dolphindb?

In dolphindb,I can create an in-memory table in dolphindb like: t = table(1 2 3 as id); And I can use sql statements at it. But I don't know the right way to delete it.The function dropTable(dbHandle, tableName) can only drop the table in…
0
votes
5 answers

Creating and dropping VIEWS in mysql

When I query a VIEW and display the results then delete the VIEW, will the result still show on master-detail page? The application I'm developing involves users searching for information in the database. Each search a user makes creates a VIEW that…
user331859
  • 51
  • 1
  • 3
  • 7
0
votes
1 answer

How to handle a client-side db drop table transaction?

I've got the following function on my client-side db: dropTable = function (a, tbl) { a.executeSql('Drop Table If Exists ' + tbl + ';', [], function(a, b){ console.log('Table "' + tbl + '" dropped.'); …
DataZombies
  • 416
  • 6
  • 19
0
votes
1 answer

Strange result when dropping table in SQL

When I drop the table in SQL I get a strange result. My table was not dropped but shows: BIN$0X1RWoaWQlSLcefLZbH5jA==$0 TABLE What is this? How can I delete the table?
misbah
  • 1
0
votes
3 answers

Delete all objects in schema using batch file in Oracle

I have below Select query which will generate delete statements to delete all objects in schema. select 'DROP '||OBJECT_TYPE||' '||OWNER||'.'||OBJECT_NAME || case when OBJECT_TYPE = 'TABLE' then ' CASCADE CONSTRAINTS PURGE'…
Andrew
  • 3,632
  • 24
  • 64
  • 113