Results 1 to 5 of 5

Thread: ASE 12.5 sql

  1. #1
    Join Date
    Jun 2014
    Posts
    3

    Post Unanswered: ASE 12.5 sql

    Hello

    Please can you help me with a batch file script to automatically create database & devices on an ASE 12.5 server ?

    Thanks
    Res

  2. #2
    Join Date
    Feb 2012
    Posts
    133
    Hi,

    can you be more specific about it.
    when you say batch file script are you pertaining to windows or unix format?

  3. #3
    Join Date
    Jun 2014
    Posts
    3

    Post Sql

    It's in windows

  4. #4
    Join Date
    Feb 2012
    Posts
    133
    i think you need to create separate file for your sql file and windows batch file.

    sample
    create a sql text file with filename create_db.sql
    on your create_db.sql it will contain the following statement.

    use master
    go
    disk init
    name="test_dat",
    physname="c:\data\test_dat.dat",
    size='256M'
    go
    disk init
    name="test_log",
    physname="c:\log\test_log.log",
    size='512M'
    go

    create datatabase TESTDB on test_dat='256M'
    log on test_log='512M'
    go

    if exists(select * from master..sysdatabases where name="TESTDB")
    begin
    print "successfully created database"
    end
    else
    begin
    print "failed to create database"
    end
    go


    open a notepad and save it on same directory with sql file and name it as
    create_db.bat. bat file will contain the following code

    @echo off
    isql -Usa -Ppassword -Sservername -i"create_db.sql" -o"create_db.log"


    sample above will do the work for you. I hope this helps.

  5. #5
    Join Date
    Jun 2014
    Posts
    3
    Thank You.

    Quote Originally Posted by makecompile View Post
    i think you need to create separate file for your sql file and windows batch file.

    sample
    create a sql text file with filename create_db.sql
    on your create_db.sql it will contain the following statement.

    use master
    go
    disk init
    name="test_dat",
    physname="c:\data\test_dat.dat",
    size='256M'
    go
    disk init
    name="test_log",
    physname="c:\log\test_log.log",
    size='512M'
    go

    create datatabase TESTDB on test_dat='256M'
    log on test_log='512M'
    go

    if exists(select * from master..sysdatabases where name="TESTDB")
    begin
    print "successfully created database"
    end
    else
    begin
    print "failed to create database"
    end
    go


    open a notepad and save it on same directory with sql file and name it as
    create_db.bat. bat file will contain the following code

    @echo off
    isql -Usa -Ppassword -Sservername -i"create_db.sql" -o"create_db.log"


    sample above will do the work for you. I hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •