Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
casati74
Posting Yak Master
109 Posts |
Posted - 2007-01-31 : 05:56:54
|
It is possible pass a parameter to a view????es:create view test@var1@var 2select * from table 1 where column1 = @var1 and column2 = @var2union allselect * from table 2 where column1 = @var1 and column2 = @var2union all..........Thank's |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-31 : 06:00:22
|
No.Peter LarssonHelsingborg, Sweden |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-01-31 : 06:13:32
|
But you can create Inline table valued function to do this:Create Function test(@var1 varchar(10), @var2 varchar(10))Returns TableasReturn(Select * from table1 where col1 = @var1 and col2 = @var2 union all ... ) Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
|
|
casati74
Posting Yak Master
109 Posts |
Posted - 2007-01-31 : 06:20:49
|
Ok also for me the functions is the only one solution!!!But i spoke with one people that ha said me there is a possible to create a parametric view!!!Thank's |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-01-31 : 06:28:11
|
he told you wrong.Go with the flow & have fun! Else fight the flow blog thingie: http://weblogs.sqlteam.com/mladenp |
|
|
|
|
|