Friday, March 30, 2012

How to rename a table ?

Hi all.

I'm porting an application from eVB-ADOCE to VB.Net-SQL CE

In the old application there are some SQL statements like this:

"ALTER TABLE OldTable TO NewTable"

Is there an equivalent instruction or a simple way to rename a table?

I was not able to find anything simple to do the same.

I really need NOT to do something like

SELECT * INTO NewTable FROM OldTable

because the resulting table could go outside memory and/or spend too much time in elaboration.

Please let me know what I can do.

Many thanks !

As far as I know, there is no such option from SQL. But you can rename a table (and a table column) using OLE DB:

QA: How do I rename a SQL CE table?

|||This is very interesting, and I read your article, but I'm so ignorant in C++ that I've not been able to translate your code in VB. |||

Don't worry - I'm working on an article that will allow you to do this from .NET CF on a device. I will post this article either today or tomorrow.

|||

Jo?o Paulo Figueira wrote:

Don't worry - I'm working on an article that will allow you to do this from .NET CF on a device. I will post this article either today or tomorrow.

That will be wonderful !

|||

As promised, here is the article:

Renaming a SQL CE Table From a .NET CF Application

|||

Joao Paulo,

I don't know how to say "thank you" for your kindness. I'm going to use your work just now.

If you come to Milano (Italy), please let me know ! I shall organize a good dinner for you

Thank you very much again !

No comments:

Post a Comment