Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
tariq2
Posting Yak Master
125 Posts |
Posted - 2011-10-19 : 09:39:31
|
| Hi,I need to alter column names in the table tijobset. Both methods below fail and I was wondering why?Many thanks1)alter table tijobsetRENAME COLUMN jobnumber to gldoc;2) EXEC sys.sp_rename 'tijobset.jobnumber','gldoc','COLUMN' |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-19 : 09:46:47
|
| sp_rename should work. are you having required access to schema tijobset?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
sqlmaster555112
Starting Member
13 Posts |
Posted - 2011-10-19 : 11:08:25
|
| Hi Tariq2If nothing is working try this onesuppose ur table tijobset has columns as value and jobnumberSelect * from tijobsetwill give an output likeValue Jobnumber1 102 53 8Now u want to change the name of jobnumber to gldocSelect Value,jobnumber as [gldoc] into tojobset1 from tojobsetthis would provide u with the table tojobset1 with columns as Value and gldocWatsay can be tried???? Later change the names of the so called tables back......do reply to this hotfix????@sqlmasterhttp://www.intelcs.com/SQL_Server_Consultant.aspx |
 |
|
|
sqldev6363
Yak Posting Veteran
54 Posts |
Posted - 2011-10-19 : 11:27:27
|
| Try this sp_rename 'tijobset.jobnumber','gldoc','COLUMN'dev |
 |
|
|
tariq2
Posting Yak Master
125 Posts |
Posted - 2011-10-19 : 13:21:50
|
| Hi guys,Although there were error messages sp_rename did actually work.Thank you |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-20 : 00:12:33
|
| what was the error messages?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-10-21 : 03:04:53
|
quote: Originally posted by tariq2 Hi guys,Although there were error messages sp_rename did actually work.Thank you
It should be a message that says about the change of column name and not the error messageMadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-21 : 04:41:47
|
| oh...i think its the standard message it gives------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|