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.
 
Back
Top