You are here: db upgrade code « MsSQL Server « IT news, forums, messages
db upgrade code

Posted by Jeff Kish on 05/16/06 23:35

Hi.
There are 3 systems a customer might have:
ancient, old, and new.

I'm trying to write a t-sql script which will be safe to run on any of the 3,
and upgrade appropriately.

unfortunately, I find that if I have a script like this, it won't compile if
running against a new system lacking col1:

if exists (informationschema....columns..)/*missing*/
begin
create table table0 col2 varchar(60)
end
else
if exists (informationschema...columns..)/*ancient*/
begin
alter table add col2 varchar(60)
update table set col2 = col1
alter table drop col1
some other stuff
end
else
if exists (informationschema...columns..)/*old*/
begin
some other stuff
end

Is there someway of writing some code to update correctly using t-sql and
handling this?

thanks
Jeff Kish

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация