Appending text to sql data

  • Hi,

    I have a query that returns page names, for example, test.aspx.

    How do I append "href" to the "test.aspx" returned from the query?

    Thank you for all the help.

  • In your SELECT, try this...

    select 'href' + columnname

    from sometable

    If it was easy, everybody would be doing it!;)

  • do you want to append href inside the file test.aspx?

    declare @var char(10)

    select @var=name from Filenames where name like '%.aspx' --sample query

    -- now @var holds the value 'test.aspx'

    -- this does not work if the query returns more than one value

    declare @qry char(100)

    set @qry = 'echo "href" >> '+@var

    xp_cmdshell @qry

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply