Add column to database table

I have an application that is going to import data from a tab delimited text file to a table in SQL Server 2005. Sometimes the column does not already exist in the database table. What do I have to write for code to go about adding a column to the database table in vb .net?
Who is Participating?
Kevin CrossConnect With a Mentor Chief Technology OfficerCommented:
If different backend database, you would just construct an appropriate SQL statement and use something like ExecuteNonQuery() from a SqlCommand object.
Kevin CrossChief Technology OfficerCommented:
You execute a SQL statement such as this for MS SQL Server for example:
ALTER TABLE your_table_name
ADD COLUMN column_name {datatype};

Open in new window

theomyshAuthor Commented:
I did not realize that it was that simple, I was searching for a much more complicated solution LOL
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.