Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: sql query help

    Try This:

    CREATE FUNCTION dbo.MyFunction

    (@ID int)

    returns varchar(2000)

    as

    begin

     declare @rtrn varchar(2000)

     declare @temp varchar(500)

     declare @rowcount int 

     set @temp = ''

     set @rowcount = 1

     set @rtrn = ''

     while(@rowcount > 0)

     begin

      select top 1 @temp = [Name]

      from MyTable

      where [id]...

Viewing post 1 (of 1 total)