Can I change a column name

G

Guest

I am new to VB 2005 Express Edition.

I created an SQL Server database according to steps in my book, but I
mispelled one of the column names (typo).

Is it possible to rename the column or is it better to delete the table
completely and retrace my steps to bring me back to where I am now?

Thanks for your help,

Joy
 
P

pvdg42

Joy said:
I am new to VB 2005 Express Edition.

I created an SQL Server database according to steps in my book, but I
mispelled one of the column names (typo).

Is it possible to rename the column or is it better to delete the table
completely and retrace my steps to bring me back to where I am now?

Thanks for your help,

Joy

It depends...
Have you made reference to the misspelled column name in your code? If so,
you'll obviously have to change all references. Other than that, changing
the column name should not be a problem.
 
G

Guest

It is me again.

I did 2 things.

Found the table in the Database Explorer.
RC on the table name > Open Table Definition
I changed the column name in the Table Definition and saved it.
I closed the Table Definition.

Then I went to the Data Sources tab, and got the database diagram back
I renamed the column and saved it.

The changes are reflected in the Database Explorer and the Data Sources tab.

Is this enough to rename a column?
I haven't used the fields in any code yet, I am just building my connection
to the SQL Server database.

Thanks,

Joy
 
C

Cor Ligthert [MVP]

Joy,

In the case of the untyped datatable this is no problem at all. As soon as
you start working with the typed datatable (generated code) than you will
have to use the edit and replace to correct that.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top