Best practices to update SQL server database schema for new application version?

  • Thread starter Thread starter Hans Merkl
  • Start date Start date
H

Hans Merkl

Hi,

I have a C# application that uses a SQL server database. I am ready to roll
out an update, but this update needs some additional fields and changed
default values for some tables together.
With Access and DAO this was easy to do because you had direct access to
the database structure via TableDef and QueryDef objects. I have done some
research but I can't find the equivalent functionality in ADO.NET.
Can anybody point me to information how to handle the following scenarios:

- Check if a field exists. If yes, change its data type and update the
existing values.
- Check if a field exists. If no, create it.

Every help is appreciated.

Hans Merkl
 
Thanks a lot. I'll check it out.

Hans

Just in case other people haqve the same problem:

OleDbConnection.GetOleDbSchemaTable retrieves a good amount of info. It's
more than FillSchema provides. Of course you have to use OleDB for this to
work.
 

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

Back
Top