April 5, 2005 at 7:23 am
Hi Everyone
Please help,
I want to amend the name of a couple of columns but I cant find the necessary help files.
Create table matsTable
(field1 char(8) not null,
field2 money not null)
go
what I want is to change field 2 to new name
alter table matsTable
(field1 char(9) not null,
newname money not null)
go
cheers
Mat
April 5, 2005 at 7:55 am
Try this one:
exec sp_rename 'matsTable.field2', 'newname', 'COLUMN'
April 5, 2005 at 8:08 am
and to complete :
ALTER TABLE matsTable
ALTER COLUMN field1 CHAR(9) not null
April 5, 2005 at 8:14 am
Thanks guys,
I have used the sp_rename
cheers
Mat
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply