Interactive Scripts

  • Hello again! Another trivial question from a Newbie.....

    In Oracle SQLPlus it is possible to prompt for user input via the "Prompt" command and use the response to direct the flow of the script.

    What is the equivalent of the "Prompt" for SQL Server scripts? I have several such scripts on the Oracle side and am trying to convert them to SQL Server scripts.....

    Any help will be greatly appreciated.

    Thanks

  • Query analyzer does not have the ability to prompt; you end up having to populate variables before you run the script like

    declare @var varchar(50

    set @var='somevalue'

    select form sometable where val=@val

     

    you could right an application that prompts you for variables and then executes a query, but not with the default tools.

     

    hope that helps.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply