Hi,
I'm struggling with SQL Server script deployment. I'd like to be able to execute an SQL statement and feed the return value to a variable. More specifically, our app only works on 2005 and we would like to verify the version of SQL Server you are connecting to. We have other things we would like to do such as verify access rights before deploying script.
Can you point me in the right direction?
Thanks,
Manso
SQL Server return values
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
I think you can take care of these inside your SQL script.
The Check Service command and Read Registry commands may also be used to check for a particular version and instance of SQL Server.
The Check Service command and Read Registry commands may also be used to check for a particular version and instance of SQL Server.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Hi,
Thanks for your reply.
>> I think you can take care of these inside your SQL script.
I certainly can but there's no way I can communicate back what went wrong. All I get is ERROR.
>> The Check Service command and Read Registry commands may also
>> be used to check for a particular version and instance of SQL Server.
The SQL Server is not typically available on the same machine so this is not an option. This must be an issue for anyone targeting a specific db version, no?
I ended up writing a console application that takes care of the SQL struff. Simply SUCCESS/ERROR is not sufficient to build a solid db initialization imho. I now have a problem communicating back detailed error messages from the console application because I only have exit codes to work with but at least I can execute it multple times asking for version, create db, apply schema etc etc.
Regards,
Manso
Thanks for your reply.
>> I think you can take care of these inside your SQL script.
I certainly can but there's no way I can communicate back what went wrong. All I get is ERROR.
>> The Check Service command and Read Registry commands may also
>> be used to check for a particular version and instance of SQL Server.
The SQL Server is not typically available on the same machine so this is not an option. This must be an issue for anyone targeting a specific db version, no?
I ended up writing a console application that takes care of the SQL struff. Simply SUCCESS/ERROR is not sufficient to build a solid db initialization imho. I now have a problem communicating back detailed error messages from the console application because I only have exit codes to work with but at least I can execute it multple times asking for version, create db, apply schema etc etc.
Regards,
Manso
Instead of creating an console application, you can simply make your script echo the return codes/text/error message to a text file (within the SQL Script), and read it through the Read Text from File command of InstallAWARE.Of course what you read, you can put it on a variable.
I think it's far more easier that way..
I think it's far more easier that way..
Panagiotis Kefalidis
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
InstallAware Software Corporation
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
InstallAware Software Corporation
Who is online
Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 215 guests