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
2 answers

Dropping tables automatically depending on modify date

Is there a way of dropping tables automatically weekly or monthly dependent on modify date? After some research on this site I found a script and modified it to the below. select 'drop table Update_Backups.[' + s.name +'].[' + t.name +']' ,…
0
votes
4 answers

Understanding DELETE and DROP command

I am a student of Computer Science. Recently I am trying to learn database. I found a link describing about the difference between DELETE and DROP command. I understand most of the difference between them with the most important one - DELETE removes…
KajolK
  • 203
  • 1
  • 3
  • 9
0
votes
1 answer

Optimize way to drop big database table

I need to drop huge database table having 1.7 Billion records. DB: Sybase, DB size: 350 gb. I ran 'drop table' statement and its taking more than 18 hours. Is there any other way to optimize it.
suraj_fale
  • 978
  • 2
  • 21
  • 53
0
votes
2 answers

I created a Global Temp Table. I cannot Drop the table

In Unix, connecting to oracle server, I create a temp table on commit preserve rows. I then first truncate the table then I go to drop the table. Trying to drop the table I receive the following error: ORA-14452: attempt to create, alter or drop an…
joepitz1
  • 194
  • 2
  • 12
0
votes
1 answer

How to drop a constraint without knowing its table?

I want to drop every user object in a SQL Server database but leave tables and its records intact. But I also want to drop its constraints. So I created this query to get drop declarations that I will paste into SMSS and execute after: SELECT …
NaN
  • 8,596
  • 20
  • 79
  • 153
0
votes
2 answers

Script to drop an index if it exists that works in SQL Server 2005 AND SQL Server Compact 3.5

I have an application with a rather long chain of upgrade scripts. The application works in SQL Server 2005 - I'm trying to upgrade it so it will also work in SQL Compact 3.5 Part of the script involves dropping old indexes if they exist. I REALLY…
Ubiquitous Che
  • 349
  • 2
  • 7
  • 20
0
votes
3 answers

SQL ALTER DROP query not working

I am learning SQL online from w3school.com. for droping a column ALTER TABLE table_name DROP COLUMN column_name command is given in SQL ALTER page i tried it in Try it yourself section provided by w3school. but it's not working I used ALTER…
singhiskng
  • 511
  • 1
  • 5
  • 15
0
votes
2 answers

How To Prevent Hibernate From Dropping My Tables

I am running into some serious issues with hibernate. It is dropping! my tables. Digging through the logs I find these two lines of code Hibernate: drop table if exists REFERENCES Hibernate: drop table if exists ACCOUNTS Now whatever…
Ace
  • 1,501
  • 4
  • 30
  • 49
0
votes
1 answer

Postgres: Drop Table according to similar schema name

I want to drop a group of tables from a lot of schemas. All the schemas that I want to drop tables starts name with "pm_". I would like to drop this group of tables from all schemas that starts with "pm_". Something like that: DROP TABLE IF EXISTS…
0
votes
1 answer

Drop database sql server in appharbor

I get a problem with AppHarBor when I use SQL Management Studio to drop database and then I can't create new database in this. So, How can I solve it?
Quang Dam
  • 305
  • 3
  • 15
0
votes
1 answer

How to Drop a SQL foreign constraint by column names

We have many DB's that are identical schema, but the FK names might not be. We do a lot of cloning for testing and such. Ran into a problem with the clone when we added a self referencing Foreign Key. We can't go back and change all the older DB's,…
Yogurt The Wise
  • 4,379
  • 4
  • 34
  • 42
0
votes
1 answer

drop tables in multischema database

I have one database called TEST. in this database I have two different schemas, one called DEV (old) and second called RC (newly added). before multipule schemas, there was no problem for dropping tables by using folloing script. DECLARE CURSOR…
abidkhan303
  • 1,761
  • 3
  • 18
  • 31
0
votes
1 answer

Oracle SQL DROP CREATE TABLESPACE error

so im trying to drop a tablespace temp with the command DROP TABLESPACE temp INCLUDING CONTENTS; but i get this error: tablespace 'temp' does not exist. however when i try and create the tablespace with this command CREATE TEMPORARY TABLESPACE…
user1459976
  • 207
  • 6
  • 14
0
votes
3 answers

NSIS- Error handling

I have written an installer and uninstaller in NSIS which creates and drops an sql database, which is working fine. I have written some .bat and .sql files to create and drop the database and then just call these files from NSIS script. My problem…
Pia
  • 463
  • 2
  • 9
  • 20
0
votes
0 answers

Deleting something off my SQLite database

I was using a tutorial on how to create a database and store input info, such as an edit text's information into it and it works great. But I'm just having one problem. The only way to delete that data is to long click the item in the activity with…
Fernando
  • 450
  • 1
  • 7
  • 22