Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8357495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:29:39+00:00 2026-06-09T10:29:39+00:00

I am automating the deployment of db scripts for a push button nightly deploy.

  • 0

I am automating the deployment of db scripts for a push button nightly deploy. My first approach was to use sqlcmd on windows terminal, save the results to txt file, and parse it to ensure the script was successful. Parsing the file and finding the return code was problematic, so I turned to TinyTds. Here is my code:

      client = TinyTds::Client.new(:username => DB_USER, :password => DB_PASSWORD, :dataserver => DB_SERVERNAME, :timeout => 1200)
      result = client.execute(IO.read(filename))
      puts result.return_code

Yields either nil or the following error (depending on the contents of the .sql script)

    run_sql.rb:24:in `execute': Attempt to initiate a new Adaptive Server operation with results pending (TinyTds::Error)

Changing

    result = client.execute(IO.read(filename))

to

    result = client.execute(IO.read(filename)).do

yields

    run_sql.rb:26:in `do': Incorrect syntax near 'go'. (TinyTds::Error)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:29:41+00:00Added an answer on June 9, 2026 at 10:29 am

    I think your answer would rely in the SQL you are trying to feed to TinyTDS. Perhaps the batch is not formatted properly for it. You also may want to just do result = client.execute(data).each too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on automating the deployment of a piece of software I've written and
Can anyone recommend any tools for automating the deployment of web services and web
I'm using Applescript to automate deployment of applications from Xcode 4. I use System
As part of automating BizTalk deployment, I'm using the following code to run process
I'm looking for some Best Practices for automating the deployment of Stored Procedures/Views/Functions/Table changes
I'm asking because PowerShell confuses me. I've been trying to write some deployment scripts
Possible Duplicate: Any ideas on automating deployment with the Google AppEngine Launcher? I tried
Hi all Our Maven scripts are currently written to compile/package & deploy in tomcat6
I'm working on automating the installer for a .NET 4.0 ClickOnce WPF application, which
I'm automating Visio 2003 from a VB.NET app. My code looks like this (with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.