[dba-SQLServer] Views With Parameters ?

Arthur Fuller artful at rogers.com
Sat Aug 7 14:37:42 CDT 2004


I feel that this answer is insufficient. Almost any view can be
translated into a table-UDF, in which case it can accept as many
parameters as you would in practice care to pass. The (IMO) huge
advantage of turning such views into UDFs as opposed to sprocs is that
you can join to them in various larger queries. Once I discovered this
(hee hee, like I discovered it! What I mean is that once I read the
documentation and ran some test cases!), I became a big fan of table
UDFs.

Just for the record, there actually is a way to return the results of a
sproc for further use, but IMO it sucks, as compared to UDFs. (OpenQuery
is the way.)

Arthur

P.S.
Forgive me. I just scrolled down to the original message and realized
that you specified version 7. UDFs are not supported in 7. So the
information above is useful only to those facing similar problems in SQL
2k and above.


-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of
paul.hartland at fsmail.net
Sent: Wednesday, July 21, 2004 8:28 AM
To: dba-sqlserver at databaseadvisors.com
Subject: Re: RE: [dba-SQLServer] Views With Parameters ?

Thought as much, thank you.

Message date : Jul 21 2004, 01:22 PM
>From : "Mike & Doris Manning"
To : dba-sqlserver at databaseadvisors.com
Copy to : 
Subject : RE: [dba-SQLServer] Views With Parameters ?
To my knowledge, views don't take parameters...only Stored Procedures
do...

Doris Manning
Database Administrator
Hargrove Inc.
www.hargroveinc.com


-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of
paul.hartland at fsmail.net
Sent: Wednesday, July 21, 2004 7:59 AM
To: dba-sqlserver
Subject: [dba-SQLServer] Views With Parameters ?


To all,
Is it possible to create a parameter type view in SQL Server 7.0, which
I can then call from Visual Basic 6. Something like SELECT * FROM
tblPersonnel WHERE tblPersonnel.PayrollNo = ? and then in VB something
like rsPerson.Open("Query '" & Me.PayrollNo & "'"),OpenSQLConn etc etc
Paul Hartland

-- 

Whatever you Wanadoo:
http://www.wanadoo.co.uk/time/

This email has been checked for most known viruses - find out more at:
http://www.wanadoo.co.uk/help/id/7098.htm
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com


_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com

-- 

Whatever you Wanadoo:
http://www.wanadoo.co.uk/time/

This email has been checked for most known viruses - find out more at:
http://www.wanadoo.co.uk/help/id/7098.htm
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com




More information about the dba-SQLServer mailing list