Results 1 to 6 of 6

Thread: Capture PRINT messages from TSQL statements

Hybrid View

  1. #1

    Thread Starter
    Fanatic Member kaffenils's Avatar
    Join Date
    Apr 2004
    Location
    Norway
    Posts
    946

    Re: Capture PRINT messages from TSQL statements

    Quote Originally Posted by szlamany
    It can't be impossible - as QA does it...

    I found this MSDN link - maybe it will help.

    http://msdn.microsoft.com/library/de...tml/vb03k4.asp

    If you get it to work, post back what you did as I would like to know for future reference.
    Thanks for the link, but I just covers how the read the messages using ADO.
    I'll keep you informed on any progress.

  2. #2

    Thread Starter
    Fanatic Member kaffenils's Avatar
    Join Date
    Apr 2004
    Location
    Norway
    Posts
    946

    Re: Capture PRINT messages from TSQL statements

    I got an answer from another forum (blasphemy ). I wasn't exactly the answer I was hoping for, but it works .... in a way ... even if it means breaking a lot of my personal "best practices".

    Anyway, here is the solution
    Code:
    CREATE TABLE #foo (
      x VARCHAR(1024)
    )
    
    INSERT INTO #foo (x)
       EXECUTE master.dbo.xp_cmdshell 'OSQL -E -Q"EXECUTE sp_smtp_sendmail @parameters...."'
    
    SELECT * FROM #foo

Posting Permissions

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



Click Here to Expand Forum to Full Width