Search code examples
powershellpowershell-2.0sybasesqlanywhere

How to specify the version in dbinit


In my system i have installed both sql anywhere 16 & 17, i need to create a database using sql anywhere 17 but while using the dbinit command in powershell its default taken sql anywhere 16.0.0 only

My Command is

$DBLocation = "E:After_Change123"

dbinit  $DBLocation       ---------> This Command is Working Fine But it creating DB in Sql AnyWhere 16

& 'C:\Program Files\SQL Anywhere 17\bin64\dbinit.exe' -dba xxx,yyyyyy $DBLocation

My Output is

S C:\Windows\System32> $DBLocation = "E:After_Change"  
& 'C:\Program Files\SQL Anywhere 17\bin64\dbinit.exe' -dba dba,sql123 $DBLocation

SQL Anywhere Initialization Utility Version 17.0.0.1358
Usage: dbinit [options] -dba <uid>,<pwd> database
@<data> expands <data> from environment variable <data> or file <data>

Options (use specified case, as shown):
   -a             accent sensitivity on all UCA string comparisons
   -af            accent sensitivity (French rules) on all
                  UCA string comparisons
   -b             blank padding of strings for comparisons
   -c             case sensitivity on all string comparisons

i want to create database in Sql anywhere 17.0.0 version how to do that help me

Thanks in Advance


Solution

  • You can specify the whole path. For example use:

    "%SQLANY16%\Bin64\dbinit" -dba xxx,yyyyyy $DBLocation

    to create a version 16 database.

    See this manual page for other options.