Stuart McLachlan
stuart at lexacorp.com.pg
Tue Oct 7 16:13:02 CDT 2008
Isn't it simpler, but effectively the same once you have created the view to write your sproc as: SELECT * FROM MyView WHERE PK = @PK On 7 Oct 2008 at 17:00, Arthur Fuller wrote: > Didn't I already answer that question, Susan? Views are a wonderful > convenience if you have a smallish number of rows, but the overhead > seriously adds up when you pass, say, 50K rows in a table -- let alone 50M > rows. > > SELECT * FROM MyView WHERE PK = 124 > > results in the case of a view that all rows in the view are sent to the > client and then the client filters the result set. By contrast, a sproc that > accepts a @PK parameter will execute on the server and transmit only the > result set over the pipe, This could be a difference of hundreds of > thousands or even millions of rows. Multiply that by the number of users. > > Views are cute and fun, but essentially stupid. That said, I build them all > the time, because I get to use the designer to build them, but then I save > them and grab the SQL generated by the designer and turn it into a > parameterized sproc or table udf. > > A. > > On Tue, Oct 7, 2008 at 3:23 PM, Susan Harkins <ssharkins at gmail.com> wrote: > > > Why? > > > > Susan H. > > > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com >