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)
 Passing input parameters to a view?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-06-11 : 10:08:31
John Niemiec writes "Can I pass input parameters to a SQL Server view just as I
can with stored procedures?

Thanks.

John Niemiec"

Nazim
A custom title

1408 Posts

Posted - 2002-06-11 : 10:20:48
you cant do it. you can rather write a stored procedure to achieve it.



-------------------------
What lies behind you and what lies ahead of you are small matters compared to what lies within you.-Ralph Waldo Emerson
Go to Top of Page

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-06-11 : 17:55:28
If on SQL 2000 have a look at table valued functions e.g.

use pubs
go

create function pubs_by_country(@country varchar(30))
returns table
as
return
select pub_id,pub_name,city,state,country
from dbo.publishers where country=@country

go

select * from pubs_by_country('USA')
go
select * from pubs_by_country('France')
go

HTH
Jasper Smith

Go to Top of Page
   

- Advertisement -