How to create a parametric View in SQL server 2000

How to create a parametric View in SQL server 2000

Post by Tor Inge Risla » Thu, 24 Jan 2002 03:50:42



Like I run a Stored Procedure with parameters I would like to run a View on
my SQL server.

sp_myStoredProcedure 'first value', 'second value'

v_myView 'first value', 'second value'

Anyone now how to declare the parameters inside the view?
It would have been nice with an example.

T. I. Rislaa

 
 
 

How to create a parametric View in SQL server 2000

Post by oj » Thu, 24 Jan 2002 04:20:40


T. I. Rislaa,

parameterized views are not supported in sqlserver (at least not currently).
so, it's not posible to pass para to view(s).

--
-oj
http://rac4sql.home.attbi.com



Quote:> Like I run a Stored Procedure with parameters I would like to run a View
on
> my SQL server.

> sp_myStoredProcedure 'first value', 'second value'

> v_myView 'first value', 'second value'

> Anyone now how to declare the parameters inside the view?
> It would have been nice with an example.

> T. I. Rislaa


 
 
 

How to create a parametric View in SQL server 2000

Post by Mike Joh » Thu, 24 Jan 2002 04:39:52


But a User defined function can achieve the same functionality.

Mike John


> T. I. Rislaa,

> parameterized views are not supported in sqlserver (at least not
currently).
> so, it's not posible to pass para to view(s).

> --
> -oj
> http://rac4sql.home.attbi.com



> > Like I run a Stored Procedure with parameters I would like to run a View
> on
> > my SQL server.

> > sp_myStoredProcedure 'first value', 'second value'

> > v_myView 'first value', 'second value'

> > Anyone now how to declare the parameters inside the view?
> > It would have been nice with an example.

> > T. I. Rislaa

 
 
 

1. Parametric sub-queries (Access Views) in SQL Server 7

I have an Access 2000 application that I am
porting to SQL Server 7

It uses nested queries with parameters e.g.
something like . .

SELECT name, SUM(Value) from
(
SELECT name, age/life*cost AS Value from
     SELECT * from table1 where clientID =
[Forms]![Input]![ClientID]
UNION ALL
SELECT name, cost*qty AS Value from
     SELECT * from table2 where clientID =
[Forms]![Input]![ClientID]
)
GROUP BY name;

I'm hoping not to re-write all the queries as
intensely complex stored procs but to simply re-
write the lowest query in the nest  as a stored
proc (stored procs take parameters, views don't).

Do stored procs act as tables/views in SQL
statments?

Like

UNION ALL

?????

Any thoughts would be appreciated!!

B.

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Sqlserveragent

3. create view from SQL Server 2000 and 2003

4. Primary chunk - a misnomer

5. Using ACCESS 2000 to create SQL Server view and Store Procedures

6. mutating tables?

7. CREATE VIEW Permissions in SQL Server 2000

8. Ask For Help

9. How to create a Oracle view in SQL 2000 Server

10. Can not create view with access 2000 ADP to SQL 2000

11. SQL 2000 B2: Can't create views/diagrams from Access 2000 project

12. How to create a new local Server or Server name on existing SQL Server 2000 installation

13. CREATE VIEW is much slower under SQL 2000