tags:

views:

149

answers:

1

Is there a DB2 v9.1 equivalent for sp_rename?

A: 

It depends on the object.

For tables and indexes, you can use the RENAME sql statement.

If you want to rename a column, you can use ALTER TABLE ... RENAME COLUMN.

For other objects, you probably have to drop and recreate it.

Hope that helps.

Michael Sharek
can i rename an sp or do i have to do a drop - create??
Rashmi Pandit
You have to do drop/create...alter procedure doesn't allow rename.http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.admin.doc/doc/r0008168.htm
Michael Sharek
Thanks Michael. I guess sp_rename in SQLServer would internally do the same. Drop and recreate.
Rashmi Pandit