Customer Portal

dbExecute and alter database statements

Comments 6

  • Avatar
    dnrickner
    0
    Comment actions Permalink
    I managed to get it working by instead of calling as a procedure, I have exec myproc for the sql statement, transaction set = one statement, and call as stored procedure = false. This works, though I am confused as to why it doesn't work when executed as a stored procedure when that is what it really is.
  • Avatar
    twaller
    0
    Comment actions Permalink
    Hello dnrickner,

    could you let me know what your stored procedure was?

    Best regards,

    Tomas Waller
  • Avatar
    dnrickner
    0
    Comment actions Permalink
    Here is my procedure
  • Avatar
    mkrivanek
    0
    Comment actions Permalink
    From the description of the error,
    ALTER DATABASE statement not allowed within multi-statement transaction

    it seems to me that the real cause of the problem was illegal value of the "Transaction set" attribute of the component.

    Could you try using the original SQL query, Call as stored procedure = true and Transaction set = One statement?
  • Avatar
    dnrickner
    0
    Comment actions Permalink
    Getting closer. It worked until I added 2 more lines to the procedure:

    use fred
    dbcc shrinkfile (fred_log, truncateonly)

    After adding these lines, I get this error:

    ERROR caused by: The executeUpdate method must not return a result set
  • Avatar
    jraszyk
    0
    Comment actions Permalink
    The DBCC SHRINKFILE statement produces a Result Set, however our code does not expect any Result Set to be returned. I can see two ways out of this.

    1) Either adjust your procedure so that it does not produce any result sets, or
    2) set the Result set output fields property on the DBExecute component - this way the component will expect there will be a result set returned and will not report it as an error. You will need to attach appropriate output edge to the component in this case.

Please sign in to leave a comment.