Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    Posts
    76

    Question Unanswered: looping through query result column and PRINT to log file....

    i am creating a log file, and at 1 point I record how many rows are deleted after an update process.. I want to also record which productID are actually deleted... how would I write that?!

    Basically I need know how I would get the list, and I am using PRINT command... I need to somehow write a loop that works through the list and PRINTS to the file....

    Thanks in advance

  2. #2
    Join Date
    Feb 2005
    Posts
    76
    I got it

    For any1 who might be interested heres how its done

    DECLARE @NbrList VarChar(300)
    SELECT @NbrList = COALESCE(@NbrList + ', ', '') + CAST(Invoice AS varchar(30))
    from TRANSACTIONS where ProductID = 'CVSDBN'
    PRINT @NbrList

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •