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 |
AAAV
Posting Yak Master
152 Posts |
Posted - 2013-01-02 : 10:00:10
|
I have to have this in a Function and can not convert it to a procedure since it is used in a cross apply. Depending on the value to a parameter say @provideri have to get the values from table Provider_A or table Provider_Bselect @strSQL='SELECT @mil_adj_12months= [mileage_adjusted_12] FROM residual_value_mileage_adjustments'+@table_suffix + ' WHERE yearly_mileage=@actual_annual_mileage and mileage_category=@Mileage_Category' execute(@strSQL)Can it be done ? |
|
AAAV
Posting Yak Master
152 Posts |
Posted - 2013-01-02 : 10:30:52
|
Solved it .... I created a view with one extra column specifying which provider it is. now in all the sqls qualified with the provider.Thanks |
|
|
|
|
|