Results 1 to 3 of 3

Thread: SQL mail

  1. #1
    Join Date
    Sep 2003
    Posts
    212

    Unanswered: SQL mail

    I have this command:

    Exec Master..xp_SendMail
    @recipients = @recipientslist,
    @subject = @subj,
    @message = @msg,
    @query = ''Select * FROM DatabaseName.user.TableName''

    But it gives me an error on the @query command. If I try the same thing without the @query command it works fine. How do I get the query to show in the mail as well?

    Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    New York, NY
    Posts
    136
    I tried this, using a single quote for query works.

    Exec Master..xp_SendMail
    @recipients = 'test@test.com',
    @subject = 'test',
    @message = 'testing',
    @query = 'Select * FROM DatabaseName.user.TableName'

  3. #3
    Join Date
    Sep 2003
    Posts
    212
    Nope i tired the same thing with single quotes, still I get the same error:

    ODBC error 8198 (42000) Could not obtain information about Windows NT group/user 'Domain\username'.

    where domain and username is the person running the query ie me

Posting Permissions

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