SQL Server Express - Change column default value
Posted on 2006-05-04
I have a table called 'Users'
In this table I have a field called 'Enabled' that is a tinyint with a length of 1 (0=disabled, 1 = enabled)
Right now, the default value for the enabled field is 0. I want to programmatically check the default value on startup, and if it is not 1, then to programmatically change the default value to 1.
I am using VS2005 pro, SQL Server express 2005, ODBC and SqlClient.SqlDataAdapter to access the database and writing everything in VB for a windows desktop application.
I have tried many things and I can't get it work.
What's the magic code to do what I would like?