Passing Parameter to view

Posts   
 
    
hyilmaz
User
Posts: 2
Joined: 08-Apr-2008
# Posted on: 08-Apr-2008 15:07:13   

I wrote a view like that


SELECT TA.pk, y, z 
FROM TA LEFT OUTER JOIN
(
    SELECT TB.fk, y FROM TB LEFT OUTER JOIN TC ON TB.FkC = TC.PkC
    WHERE date is null OR date > @paramDate
) AS T1 ON TA.pk = T1.fk

I want to pass a value to @paramDate parameter from my code. here I do not want WHERE clause to attached at the bottom line. it's position important to me.

I could not find anything that allow me to do that in the documentation.

Is it posibble or what you advise me to do

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 09-Apr-2008 11:42:07   

You can't pass a parameter to a database View, but you can pass a parameter to a stored procedure. (This is a SQL limitation)

hyilmaz
User
Posts: 2
Joined: 08-Apr-2008
# Posted on: 09-Apr-2008 14:05:44   

thanks a lot but this made me sad