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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Really need help w/ this

Status
Not open for further replies.

katgirl

Programmer
Jul 6, 2006
114
US
I have about 20 tables. I need to create DROP and CREATE statements for all Primary Keys, Foreign Keys, and Indexes on the table.

I would like a script that can do this in one handy step.

Using the EM scripting, I can only do CREATE statements, not the drop statements.

I've searched all over the internet, I can't find one singel script that can do this for me.

Please help, if anyone has a script to do this... I will leave multiple stars

:)
 
...

Generate Scripts... Formatting... (Tick the box for drop objects) ... Options (Script PK,FK ...indexes ...etc etc)
 
When you drop a table the keys and indexes are dropped automatically.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top