alter function F_GetUserPostion(@userName varchar(120)) returns varchar(600)
as
begin


Declare curGetUserPostion Cursor
    for
select (select column_Name from Hr_Professional where Column_id=Hr_Intention.GSsortID) from Hr_Intention where GuserName=@userName 

  Declare @ColumnName  varchar(120)
  Declare @body  varchar(600)

--初始化

  Set @body=''
set  @ColumnName=''

  --打开游标
  Open curGetUserPostion

  --循环并提取记录
  Fetch Next From curGetUserPostion Into @ColumnName  
  While ( @@Fetch_Status=0 )  
  begin
--更新到汇总表。
set @body = @body+'-'+@ColumnName
  
Fetch Next From curGetUserPostion Into @ColumnName  
     

end
  --关闭游标  
  Close curGetUserPostion
  --释放游标
  Deallocate curGetUserPostion
return @body
end

相关文章:

  • 2021-12-18
  • 2022-02-13
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2021-09-10
猜你喜欢
  • 2022-12-23
  • 2022-03-04
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案