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

create field, delete field and rename a table

Status
Not open for further replies.

HebieBug

Programmer
Joined
Jan 8, 2001
Messages
354
Location
JP
Am creating a package and want to be able to add a field to a table. The setting of the package is no problem just would like to know what SQL string or statement I need to enter.
There are some other ones as well
* how to delete a field
* rename a table

Does anyone know the answer to these ones?
 

Look in SQL BOL for Alter Table.

Alter Table TableName Add NewCol varchar(12) Null
Alter Table TableName Drop Column OldCol

EXEC sp_rename 'OlDTableName', 'NewTableName'

sp_rename is also documented in SQL BOL.
Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top