Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does an execution plan for view saved in an SP?

Status
Not open for further replies.

sobeit

Programmer
Sep 11, 2000
38
US
Everyone is suggesting not to refer to a view in a Stored Procedure because the precompile version of the SP does not include the execution plan for the views that are being used in the SP. Is this true?

I don't see why referencing a view in a SP is any different that referencing tables directly. I am trying to simplify my stored procedure by reducing the some of the statements that are redundents.

Does anyone know for sure that SQL Server really does NOT save the execution plan for the view?
 
SQL Advanced Server 2000

I use views in my stored procedures. I don't have any problems at all and the views don't exist until my SP creates them.

I use views in my jobs. If the view does not exist (when it is parsed), I get an error message stating that. The job will still run just fine. In my job step creation, when I get the error, I just tell it that it's ok.


-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top