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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Views

Status
Not open for further replies.

VBXL

Programmer
Jul 10, 2001
198
GB
Is it possible to pass a variable into a View

if so, how do you do it.

Cheers

GazC
 
Hi GazC,
Views are created to show only the required information to the users and you can use view just like tables (i.e. select/ insert/ update/ delete).
 

No, you cannot pass a variable to a view. Views do not execute code. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
Hi,

You can have a view on combination of tables but cannot insert, update or delete if a view is created on multiple tables.
 

Updatable views can modify more than one table involved in the view. The DELETE, INSERT, and UPDATE statements can reference a view as long as SQL Server can translate the user's update request unambiguously to updates in the base tables referenced in the view's definition. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
Not sure what you're trying to do, but perhaps you could create a stored procedure that accepts an input parameter and use this parameter inside the procedure w/ dynamic sql statement (sp_executesql) to return the appropriate result set.

Hope this helps...

JJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top