Avatar of TimHudspith
TimHudspith asked on

After renaming a column in SQL Server 2008, the name doesn't change in table design view

Once I rename a column in a table by using sp_RENAME (as below), I can see that the name has changed when I view the table in 'edit all rows' mode, but it still has the old column name in design view. I refresh the table - and even the database - but the column still has the old name in design view. Only when I close and reopen SSMS has it updated.

sp_RENAME 'TableName.OldColumnName' , 'NewColumnName', 'COLUMN'
Microsoft SQL Server 2008

Avatar of undefined
Last Comment
TimHudspith

8/22/2022 - Mon
Raja Jegan R

Seems like a Refresh issue, can you kindly refresh the table after altering the column name and try opening it in designer again.
ASKER
TimHudspith

Well, I've tried it again and now it seems to be behaving as it should. I can't explain it.
Raja Jegan R

Yes, it seems like a Refresh issue only.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER
TimHudspith

So is SQL Server known to be a bit temperamental in this respect? Something I should get used to?
Raja Jegan R

Actually it is not like that, SQL Server considers everything as a Session.
Object explorer is a session and your query window where you edited the table is a session.
Changes done in one session is not visible to the other session unless the other session refreshes it.
So, refreshing the object explorer will reflect the changes done for tables in other sessions.
ASKER
TimHudspith

I've just added a column to a table and still have the same problem. I immediately went to the Object Explorer, selected the table, right-clicked, refreshed, then opened in Design view, but the new column was not added. By contrast it IS visible when I view the table via the 'edit all rows' option.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Raja Jegan R

I've tried it in my local with SQL Server 2008 SP3 installed and SQL Server 2008 R2 SP2 and it works fine without any issues. Can you kindly confirm whether you have the latest SP's installed for your instance and if not apply the latest SP's and try once..
ASKER
TimHudspith

How do I determine which SP I have?
Raja Jegan R

Try running this in your query window and it will tell the Service pack details.

select SERVERPROPERTY('productlevel')
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER
TimHudspith

The result is SP1.
ASKER CERTIFIED SOLUTION
Raja Jegan R

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
TimHudspith

I have Windows 7. Which one do I download?

SQLServer2008SP3-KB2546951-IA64-ENU.exe
SQLServer2008SP3-KB2546951-x64-ENU.exe
SQLServer2008SP3-KB2546951-x86-ENU.exe
Raja Jegan R

Hope you would be having a 64 bit machine, if that is the case then SQLServer2008SP3-KB2546951-x64-ENU.exe else SQLServer2008SP3-KB2546951-x86-ENU.exe
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
TimHudspith

That seems to have done it. Thanks.