--建表create table M( id int, dict varchar(10))Create Table N( billno int, dictdoc varchar(100))--插入数据insert into M values(1,'A')insert into M values(2,'B')insert into M values(3,'C')insert into M values(4,'D')insert into N values(1,'1,2,3')insert into N values(2,'2,3')insert into N values(3,'1,2,3,4') --创建函数Create Function fn_myStr(Str Varchar(8000))returns Varchar(8000)AsBegin Declare RSt Varchar(8000)=Str Select RSt=replace(RSt,id,dict) From M Return RStEnd--查询Select * from M select billno,dbo.fn_myStr(dictdoc) As dictdoc from N ...