Reputation: 614
I have a SQL Script with the following line
declare @input varchar(20)
Select * from Employees where [dept] = @input
What I want is When I execute the above script in SQL 2005 I want to prompt for an input By opening an inputbox etc., such that the value is accepted in '@input' variable and so the user retrieves the records giving dynamic inputs.
Upvotes: 1
Views: 10419
Reputation: 9986
Or use C#; Rapid Application Development Using SQL Server 2005 Compact Edition and Visual C#.NET
Upvotes: 0
Reputation: 3308
Here's what you want
Accepting User Input
But it's for Oracle( ! ) . I hope this will work for other dbs also
Upvotes: 1
Reputation: 23949
You're really asking for a nonexistent feature but there are a few workarounds:
Upvotes: 1
Reputation: 700552
You can't do that. The database doesn't have a user interface, so there are no means of prompting for a value.
You have to make an application that prompts for the value, queries the database and displays the result.
Upvotes: 1