Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hiii all
i want to make aview in sqlserver 2008 . this view will take aparmeter and return some columns.

i tried to make that
<br />
Select customer, name from scheme.custm Where customer=?<br />


but there was an error
VB
There's a SQL Syntax error message - "Parameters cannot be used in this query type."



any help,
thanks
Posted
Comments
Abdul Quader Mamun 6-Feb-11 4:26am    
Use Store Procedure.

1 solution

Views can not take parameters.

You can either create a stored procedure, or create the view and select from the view using a parameterized query.

Regards
Espen Harlinn
 
Share this answer
 
Comments
fjdiewornncalwe 6-Feb-11 11:05am    
+5. Simple and complete. I like the fact that you didn't suggest to him the methodology that would allow direct access to his db objects.
Espen Harlinn 6-Feb-11 11:19am    
Thanks Marcus!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900