While doing
create table #tmpsr(
srid int,
W_DiffOriginal decimal(12,2)
)
insert into #tmpsr
(srid,W_DiffOriginal)
select sr_id, --- From Table
W_DiffOriginal=DiffOriginal --- From Function
From TBL_SR,dbo.fnc_VoucherDetails_Get(sr_id) ---Table-Valued Function
Where SRdoid = 12811 --- Column in the table TBL_SR
and fsrid=sr_id ---fsrid: Columns in the Table-Valued Function,
I Got the message :
Msg 207, Level 16, State 1, Line 9 Invalid column name 'sr_id'.
Any Idea?