2012年2月13日星期一

Batch file and use of isql command

Hi,
I'm trying to figure out how to be able to run a batch
file, go to the database, find the current application
version of our product and based on that result it
returns, run a specific script. We have a table that
holds all of the builds/releases of the application that
have been applied against the database. Based on the
information there (the max build/release number), I want
it to execute a specific SQL script that will upgrade them
to the next build/release.
For example, we have a table called DBVersion with one
column in it (AppsVersion). In this table, it has rows
that are as follows:
8.0.100.0
8.0.101.0
8.0.102.0
We have two upgrade paths that we will support. In the
example above, we can upgrade a customer who are in
8.0.100.0 or 8.0.102.0 to the new release number
8.0.103.0. We have two upgrade scripts...one that holds
all db changes from 8.0.100.0 to 8.0.103.0 and one that
holds all db changes from 8.0.102.0 to 8.0.103.0. I want
to create a batch file that finds the version they are on
and run a specific script to upgrade them to the new
release.
Thank you in advance,
DeeHi, this line of SQL maybe helps you
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'),
SERVERPROPERTY ('edition')
greatings, Cesar
"Dee" wrote:
> Hi,
> I'm trying to figure out how to be able to run a batch
> file, go to the database, find the current application
> version of our product and based on that result it
> returns, run a specific script. We have a table that
> holds all of the builds/releases of the application that
> have been applied against the database. Based on the
> information there (the max build/release number), I want
> it to execute a specific SQL script that will upgrade them
> to the next build/release.
> For example, we have a table called DBVersion with one
> column in it (AppsVersion). In this table, it has rows
> that are as follows:
> 8.0.100.0
> 8.0.101.0
> 8.0.102.0
> We have two upgrade paths that we will support. In the
> example above, we can upgrade a customer who are in
> 8.0.100.0 or 8.0.102.0 to the new release number
> 8.0.103.0. We have two upgrade scripts...one that holds
> all db changes from 8.0.100.0 to 8.0.103.0 and one that
> holds all db changes from 8.0.102.0 to 8.0.103.0. I want
> to create a batch file that finds the version they are on
> and run a specific script to upgrade them to the new
> release.
> Thank you in advance,
> Dee
>|||Hi Cesar,
Thank you for your response. Actually, the version that I
was implying was our own product's application version and
not SQL Server's.
Thanks again,
Dee
>--Original Message--
>Hi, this line of SQL maybe helps you
>SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY
('productlevel'),
>SERVERPROPERTY ('edition')
>greatings, Cesar
>"Dee" wrote:
>> Hi,
>> I'm trying to figure out how to be able to run a batch
>> file, go to the database, find the current application
>> version of our product and based on that result it
>> returns, run a specific script. We have a table that
>> holds all of the builds/releases of the application
that
>> have been applied against the database. Based on the
>> information there (the max build/release number), I
want
>> it to execute a specific SQL script that will upgrade
them
>> to the next build/release.
>> For example, we have a table called DBVersion with one
>> column in it (AppsVersion). In this table, it has rows
>> that are as follows:
>> 8.0.100.0
>> 8.0.101.0
>> 8.0.102.0
>> We have two upgrade paths that we will support. In the
>> example above, we can upgrade a customer who are in
>> 8.0.100.0 or 8.0.102.0 to the new release number
>> 8.0.103.0. We have two upgrade scripts...one that
holds
>> all db changes from 8.0.100.0 to 8.0.103.0 and one that
>> holds all db changes from 8.0.102.0 to 8.0.103.0. I
want
>> to create a batch file that finds the version they are
on
>> and run a specific script to upgrade them to the new
>> release.
>> Thank you in advance,
>> Dee
>.
>

没有评论:

发表评论