HowTo: Rename SQL Tables in Visual Studio

imageThe integration of SQL Servers in Visual Studio is really great. I use VS to create my SQL tables and simple administration stuff – it´s not often that I start SQL Management Studio. But one thing is really annoying: You can´t rename SQL Tables in VS! But there is a little trick to do that.

The context menu:

image

Unfortunately there is no "rename" button here and the name property is disabled.

The trick:
Just add the tables to an database diagram and rename it there and save it – that´s it.

I found this nice trick on this site – there are some cool features in the database diagram view.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

About the author

Written by Code Inside Team

Currently there is no additional info about this author.

6 Responses

  1. Can’t you rename it by using “F2″ key while selecting the tablename node from the tree ? Never tried myself though so I could be wrong!

    Reply
  2. This is great thanks!

    I tried using ALTER TABLE clause with RENAME TO and it didn’t work. I think the way you propose is the only way.

    Reply
  3. Please copy this table to new table name and then delete old table.

    Query
    =====

    insert into New_TableName
    select *
    from Old_TableName

    Reply
  4. Thanksssssssssssssss!!

    Was going nuts on this small but so important thingy :)

    Reply
  5. 1. In Server Explorer, right-click the table you want to rename and choose Open Table Definition from the shortcut menu.

    The table opens in the Table Definition window of Table Designer.
    2. Right-click the table in the Table Definition window and choose Properties from the shortcut menu.
    3. In the field for the Name value in the Properties window, type a new name for the table.

    4. To cancel this action, press the ESC key before leaving this field.

    5. From the File menu choose Save table name.

    Here is the direct link
    http://msdn.microsoft.com/en-us/library/bw5xhetd.aspx

    Reply

Comment on this post

Recent Posts

  • image1528-570x194_thumb.png
    Introduction to Redis on Windows & Redis usage with .NET

      Redis belongs to the NoSQL data banks and you will find it in the group of Key-Value Stores. Redis is often named “Blazing Fast” and according to the Stackoverflow Thread it is used to be two time (while writing) and three times (while reading) quicker than MongoDB. Even if the comparison is a little ...

  • Automated Security Analyser for ASP.NET websites

    Evil Hackers are lurking everywhere and many Web-applications are delicately and share “too much” with the attacker. A quick (first!) overview offers the Tool “ASafaWeb”. All the website does is making a few requests and writing an Analyses including problem solving’s. There are no permanent disadvantages (bad requests/ DoS attacks and so on). Example: KnowYourStack.com ...

  • image1489-570x194.png
    „Sign in with Twitter“ for your own ASP.NET WebApp

      “Sign in with Twitter” is a popular practice to authenticate the users on your website. One advantage compared to an own registration is the lower inhibition for the user. But on the other hand Twitter doesn’t fess up with all the information’s and you will get into a kind of addiction. At the end ...

  • image1485-570x194_thumb.png
    CodePlex is going to be updated

      CodePlex the Microsoft Open Source Project Hosting Plattform hasn’t changed that much in the last few years and for a few times I thought Microsoft stopped the whole developing process. But now I found out that there is still life in the project. Maybe it is because of the success of GitHub or because ...

  • image1474_thumb.png
    What does Adobe in the flash-free web? Magazine-Style Layouts with CSS Regions!

      Adobe is well known for Photoshop and Flash but of course there is a lot more. According to the “Future Post” from Google Adobe declared one of their big subjects on a Blogpost. I’m talking about the W3C Working Draft to CSS Regions. Adobe cooperates with the WebKit Team and W3C on this. What ...

Support us