I need to have my application check the database everytime my application loads. O want it to check the entire schema based on a text document containing all schema information for the database version required by the software version.
i want to automatically generate the schema file.
the application muust then check for errors within the database, for example if an error in the field size occurs i want it to create a script similar to;
;========================================================================
;
; Fri, 16/07/2010 at 23:26:40
;
;========================================================================
;Table CfgMedia
;------------------------------------------------------------------------
;Field [DefName] is wrongly defined
Alter table [CfgMedia] add [AutoFixTemp] VARCHAR(24) NULL
Update [CfgMedia] set [AutoFixTemp] = [DefName]
Alter table [CfgMedia] drop column [DefName]
Alter table [CfgMedia] add [DefName] VARCHAR(24) NULL
Update [CfgMedia] set [DefName] = [AutoFixTemp]
Alter table [CfgMedia] drop column [AutoFixTemp]
;========================================================================
;
; End of script
; Fri, 16/07/2010 at 23:26:42
;
;========================================================================
or if no problems are found then produce a script like
;========================================================================
;
; Fri, 16/07/2010 at 23:26:40
;
;========================================================================
;
; No problems found
;
This is on a very tight budget, but this does need to work;
Basically what i need is;
1) Generate a Schema File for it to compare
2) Check the database against the schema file and if error are found, then automatically create a script to repair the errors.
3) The schema file must have on 1 line the database version so no mistakes can be made where incorrect schemas are processed.
Please help
Thanks
Hi there
I'm a programmer for more than 10 years using vb6, sql, pl-sql, crystal reports, and also more than 2 years using vb.net
I can do this
Count me in