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)
 Get user input in SQL Server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-09-13 : 09:50:39
John writes "I want to write a stored procedure that can ask the user for input and return a string. I have never done this before, I have never seen it done, I don't even have a clue if it's possible (I can't find anything in SQL Server Books Online that says anything about it), but I need to do it. If you can tell me how, I will acknowledge you as God.

John"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-09-13 : 10:30:02
Generally, this is exactly what stored procs do.

create procedure john
@someinput varchar(10)
as
select 'You just passed me: ' + isnull(@someinput,'squat')
go

exec john 'blah'

 
The thing I am curious about is you language ...
quote:
a stored procedure that can ask the user for input

Stored Procs don't ask. A stored procedure is simply a pre-compiled batch of T-SQL code. You execute the stored proc and you process what it returns to you ...

Jay White
{0}
Go to Top of Page
   

- Advertisement -