Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Posts
    55

    Unanswered: UPDATETEXT fails, yet no error message

    I have the following T-SQL

    Code:
    SELECT @SplitContentName = (
    			SELECT TOP 1 OzSubcategory.Subcategory
    			FROM OzNetLaw.dbo.contents AS OzContent
    			JOIN OzNetLaw.dbo.subcategories AS OzSubcategory ON OzSubcategory.SubcategoryId = OzContent.SubcategoryId
    			WHERE OzContent.ContentID = @SplitPeice
    		)
    
    		SELECT @SplitContentParentName = (SELECT TabName FROM Tabs WHERE TabId = @UpdateTabParentId)
    
    		SELECT @SplitTabId = (SELECT TOP 1 TabId FROM Tabs WHERE TabName = @SplitContentName ORDER BY TabId DESC)
    
    		SET @OtherRelevantArticlesParsed = @OtherRelevantArticlesParsed + '<a href="http://' + @PortalAlias + '/' + @ParentTabName + '/' + @SplitContentParentName + '/">Justin</a>'
    
    UPDATETEXT HtmlText.DesktopHtml @DesktopHtmlPointer NULL 0 @OtherRelevantArticlesParsed
    Now, when run, that code is executed, and the new link appears on the end of my text field.

    However, when i run it with the change in red, it basically resets the '@OtherRelevantArticlesParsed' variable to nothing (not null, as no errors are reported.)

    Code:
    SET @OtherRelevantArticlesParsed = @OtherRelevantArticlesParsed + '<a href="http://' + @PortalAlias + '/' + @ParentTabName + '/' + @SplitContentParentName + '/' + @SplitContentName + '/">Justin</a>'
    Note, all variabled are declared properly, as the previous example is run.

    @SplitContentName is declared as follows:
    DECLARE @SplitContentName VARCHAR(500)


    PRINT(@SplitContentName)
    PRINT(@SplitPeice)

    Those Print Statements print the value that they should. @SplitPeice is INT.

    can anyone shed some light onto this?

    Cheers,

    Justin

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    What is the result of the following statement right before UPDATETEXT:

    print @OtherRelevantArticlesParsed

    ???
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

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