Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Script Oracle to SQL

Status
Not open for further replies.

mwmartens

Programmer
Dec 27, 2000
2
US
I am trying to convert an Oracle script to SQL, and am having trouble with the
following snippet...help please!!!

DROP TABLE pni_caption CASCADE CONSTRAINTS

SQL says the problem is "near" cascade.

Help B-(
 
I dont believe MS SQL Server has this option. Sounds like Oracle is attempting to be convenient and drop any tables that are related to the table being dropped (ie. tables with foreign keys to this one).

With SQL Server, you will need to drop all the "child" tables first, then drop the table in the script. Fortunately, with SQL Enterprise Manager, you can right click on a table, choose All Tasks and select Display Dependencies to find out what tables are dependent on the table being dropped.
 
This is not an option in T-SQL. Simple drop the table and off of it's a associated constraints will be dropped.

If your intention is to drop related tables, then you will have to drop them individually. Tom Davis
tdavis@sark.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top