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 2005 Forums
 Transact-SQL (2005)
 SQL Parameter Driven Query

Author  Topic 

chava_sree
Yak Posting Veteran

56 Posts

Posted - 2008-03-28 : 17:20:07
Hi all,

I've a query which i need to run as Parameter Driven, where SQL asks me for an input let's say for a Date in a query. is this possible in SQL SERVER like in Oracle, if so can anybody suggest me where do i look at.

here's my quer.

SELECT * FROM TABLE
WHERE DATE > '1/01/2008'

instead of 1/01/2008 Sql Prompts me to enter my own Date and display the result.

pls.help..me and thanks in advance.

PeterNeo
Constraint Violating Yak Guru

357 Posts

Posted - 2008-03-29 : 01:02:06
No, it is not possible

try something like this

Declare @Date DateTime
Select @Date = '1/01/2008'

SELECT * FROM TABLE
WHERE DATE > @Date
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-03-29 : 02:00:53
You need to create a procedure wih parameter for value entry. The values for parameters are entered from your front end aplication like VB
Go to Top of Page
   

- Advertisement -