Solved

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

Posted on 2013-12-30
14
684 Views
Last Modified: 2013-12-30
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'
0
Comment
Question by:TimHudspith
  • 7
  • 7
14 Comments
 
LVL 57

Expert Comment

by:Raja Jegan R
Comment Utility
Seems like a Refresh issue, can you kindly refresh the table after altering the column name and try opening it in designer again.
0
 

Author Comment

by:TimHudspith
Comment Utility
Well, I've tried it again and now it seems to be behaving as it should. I can't explain it.
0
 
LVL 57

Expert Comment

by:Raja Jegan R
Comment Utility
Yes, it seems like a Refresh issue only.
0
 

Author Comment

by:TimHudspith
Comment Utility
So is SQL Server known to be a bit temperamental in this respect? Something I should get used to?
0
 
LVL 57

Expert Comment

by:Raja Jegan R
Comment Utility
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.
0
 

Author Comment

by:TimHudspith
Comment Utility
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.
0
 
LVL 57

Expert Comment

by:Raja Jegan R
Comment Utility
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..
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

Author Comment

by:TimHudspith
Comment Utility
How do I determine which SP I have?
0
 
LVL 57

Expert Comment

by:Raja Jegan R
Comment Utility
Try running this in your query window and it will tell the Service pack details.

select SERVERPROPERTY('productlevel')
0
 

Author Comment

by:TimHudspith
Comment Utility
The result is SP1.
0
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 500 total points
Comment Utility
If that is the case, can you try applying SP3 for SQL Server 2008 from the link below and check once.
http://www.microsoft.com/en-in/download/details.aspx?id=27594
0
 

Author Comment

by:TimHudspith
Comment Utility
I have Windows 7. Which one do I download?

SQLServer2008SP3-KB2546951-IA64-ENU.exe
SQLServer2008SP3-KB2546951-x64-ENU.exe
SQLServer2008SP3-KB2546951-x86-ENU.exe
0
 
LVL 57

Expert Comment

by:Raja Jegan R
Comment Utility
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
0
 

Author Comment

by:TimHudspith
Comment Utility
That seems to have done it. Thanks.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now