Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 getting user input from within a script running in Query analyser

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-06-29 : 11:29:22
Otto writes "Is it possible to ask a question to a user of a script (stored procedure or something like that) and use the answer (an integer in my specific situation) within the rest of the procedure?

I wrote a 'program' to check some data consistency for a specific set of records, depending on a id in that table. I would like to ask the user for the ID of the record set, because one set could possibly consist of over a million records and it would take lots of time if one does not change the value in the script the first time to the right value.

I use the program from within the query analyser by opening it and executing it. The output will be in the message window."

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2004-06-29 : 11:36:44
I don't think this is possible from QA. For user intervention use front end.

------------------------
I think, therefore I am
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-06-29 : 12:31:34
YOu could write the script as a Template for QA and then press Ctrl+Shift+M (Edit : Replace Template Parameters) to get the User Interface, but it would be a bit manky!

Kristen
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-06-29 : 12:47:45
Or EXEC mySproc99 paramater1, parameter2...

QA is a developers tool...not an interface...go use Access and link the tables...and use passthru queries...


Brett

8-)
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-06-29 : 13:39:13
Good point Brett. I have some of my SProcs display "help" output if given no parmaeters, which is good enough for the developers using stuff like the "Make Me A Database" Sproc.

Actually, its perfectly fine as a user interface as well, now I think about it ... they've had it too good for too long!

Kristen
Go to Top of Page
   

- Advertisement -