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

  • WebDev Playground: dabblet.com for HTML/CSS, jsfiddler.com for JS & HUrl.it for REST

      What was reserved for mighty Desktop Apps in the past is now coming closer to the web. I’ve going to present three tools to you which are very useful for web developer. At least all the tools are quite cool in there functionality. Playground for HTML/CSS If you need a quick Playground for CSS ...

  • image1452_thumb.png
    Javascript to Dart Translator

      Dart, a Google Javascript alternative was presented a few months ago and the web developer scene are a little bit unsure about the usability of Dart. To declare the language Google has translated the Javascript basics into Dart. The result is this “Translator”. In my opinion the name doesn’t find that well because it’s ...

  • image1366-570x194.png
    Twitter Bootstrap as UI-kit

      HTML and CSS are not foreign words for me but I regret, I’m not a Web designer – I see myself as a webdeveloper. But at least a dressy side is a must. But thank good there are some ready “Systems”. Twitter Bootstrap Twitter Bootstrap is a Toolkit for every kind of Web applications. ...

  • image1441.png
    Fix: the value ‚x‘ is not valid for Foo in ASP.NET MVC

      To get files into the MVC Controller Modelbinding from MVC is a clever method. But in fact it is a little bit complicated to set the error message if the connection failed. Example: public class RegisterModel { ... [Required] [DataType(DataType.EmailAddress)] [Display(Name = "Email address")] public string Email { get; set; } [Required] [Display(Name = ...

  • You Tube API – recall Video Meta files with .NET

      A loooong time ago I’ve blogged about how to access to You Tube with the Google Data APIs. After all that time there are several new ways how to recall files. Google offers You Tube a “simple” surface. If you prefer to do low-Level HTTP calls it is also possible. Aim: I want the ...

Support us