-
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
-
Do you have permission on the table?
-
use single quote for the query, double quote has special meaning if you have set quoted identifier to true.
Exec Master..xp_SendMail
@recipients = @recipientslist,
@subject = @subj,
@message = @msg,
@query = 'Select * FROM DatabaseName.user.TableName'
-
Yes I have permission to the table. I'm in the adminsitrator group and the using the single quote in @query still gives me this error:
ODBC error 8198 (42000) Could not obtain information about Windows NT group/user 'domain\username'.
-
What permission does your windows account have on target db and table? Member of dbo or something else? Get any result if run 'Select * FROM DatabaseName.user.TableName' alone?
-
I can 'Select * from tablename' on QA just fine.
-
What's sql server service account? Does the account have permission on the table?
-
Did you create a mail profile for the sql server service account in outlook?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|