Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Posts
    4

    Unanswered: storing variable in command file from SQL Server

    Hi,
    i am using command files(.cmd) and osql utility to conneft to a database.
    following is the requirement.
    I have a query "SELECT top 1 au_fname FROM pubs..authors".

    Can i store the value of au_fname in the command file?

    Is there any work around for this.

    Any help is appreciated.

    Thanks....

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    There are more ways to skin a cat than there are cats, but that is no reason to stop trying!

    It is possible to trap a returned value using the command interpreter, but it is uglier than sin and completely unsupported. I'd strongly recommend using either Perl or PHP to write the script instead of using the command interpreter, or at the very least using them to handle this specific part of the task your script is doing.

    -PatP

Posting Permissions

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