Hi,
I have a SQL script for MS SQLServer that creates a series of tables, one table is named 'META' and contains the field 'dbver' (database version). I would like to update my script so that updates to the database can be applied by checking the database version and would like to know if this is possible? I cannot figure out how to compare a value in the database using the script (peusdo-code below). Any help would be very useful, hope this makes sense! Thank you
if dbver = 1 then // how do i read the current value in the database?
begin
perform updates on database for new version
insert into meta values('2'); go
end
if dbver = 2 then
begin
perform updates on database for new version
insert into meta values('3'); go
end
I have a SQL script for MS SQLServer that creates a series of tables, one table is named 'META' and contains the field 'dbver' (database version). I would like to update my script so that updates to the database can be applied by checking the database version and would like to know if this is possible? I cannot figure out how to compare a value in the database using the script (peusdo-code below). Any help would be very useful, hope this makes sense! Thank you
if dbver = 1 then // how do i read the current value in the database?
begin
perform updates on database for new version
insert into meta values('2'); go
end
if dbver = 2 then
begin
perform updates on database for new version
insert into meta values('3'); go
end