sql server - SQL Select with a function -
i have following sql statement :
select rtrim(ltrim(replace(lagkart.varenummer,char(2),''))) itemno, rtrim(ltrim(replace(lagkart.sxson,char(2),''))) season, isnull(rtrim(ltrim(replace(lagkart.variant1,char(2),''))),'') variant1, isnull(rtrim(ltrim(replace(lagkart.variant2,char(2),''))),'') variant2, (select * [dbo].[b2bgetspringfinal] ( lagkart.varenummer, lagkart.variant1, lagkart.variant2 )) springavailable lagkart
but error :
msg 170, level 15, state 1, line 8
incorrect syntax near '.'.
but if call function fixed values :
select rtrim(ltrim(replace(lagkart.varenummer,char(2),''))) itemno, rtrim(ltrim(replace(lagkart.sxson,char(2),''))) season, isnull(rtrim(ltrim(replace(lagkart.variant1,char(2),''))),'') variant1, isnull(rtrim(ltrim(replace(lagkart.variant2,char(2),''))),'') variant2, (select * [dbo].[b2bgetspringfinal] ( '6261', 'black', 's' )) springavailable lagkart
i desired result.
any ideas?
br mads
in sql server 2000, constants , @local_variables can passed table-valued functions. in sql 2005 , greater fixed. try using scalar function springavailable
column value instead, or @ upgrading newer sql server version.
Comments
Post a Comment