Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Location
    New Jersey
    Posts
    65

    Unanswered: Complex SP Issues (REPLACE and Transactions)

    EDIT: Most of this thread was self-solved. The result is:

    To REPLACE with an SP variable, use this syntax:

    Code:
         DECLARE @SQL AS VARCHAR(4000)
         
         SELECT @SQL = REPLACE('A','B','C')
    The only outstanding question from the original thread content is:

    When using EXEC, does it remain within the scope of a TRANS?
    Code:
        BEGIN
                   BEGIN TRAN T1
        SET @SQL = 'Some SQL statement'		
        EXEC (@SQL)
         COMMIT TRAN T1
        END
                   GO
    Last edited by HardCode; 12-05-05 at 17:30.
    Retired Moderator at Xtreme VB Talk, for all of your Visual Basic needs.

  2. #2
    Join Date
    Oct 2004
    Location
    New Jersey
    Posts
    65
    I fixed the sysmessages table error. Just a simple transposition of 'master.dbo.sysmessages'. And it appears the "Incorrect syntax near '<' is a result of the failed REPLACEs.
    Last edited by HardCode; 12-05-05 at 13:46.
    Retired Moderator at Xtreme VB Talk, for all of your Visual Basic needs.

Posting Permissions

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