1

Could not find the table sysmail_mailitems in SQL Server 2008 R2.

Can you help me find that table?

Raidri
  • 17,258
  • 9
  • 62
  • 65
superbun1
  • 129
  • 1
  • 4
  • 6

1 Answers1

3

This table is in the msdb database.

SELECT * FROM msdb.dbo.sysmail_mailitems;
Aaron Bertrand
  • 272,866
  • 37
  • 466
  • 490
  • i tried your query but it is giving the srror message "The SELECT permission was denied on the object 'sysmail_mailitems', database 'msdb', schema 'dbo'." – superbun1 Sep 07 '11 at 19:31
  • 1
    so is that problem with granting access to system tables.do i need ask dba reg this. – superbun1 Sep 07 '11 at 19:32
  • 1
    Yes, the dba will need to grant access. However I've been using database mail since SQL Server 2005 and don't recall ever having to go snooping in this table manually - what are you looking for exactly? Could what you're looking for be easier to find in the database mail log? – Aaron Bertrand Sep 07 '11 at 19:35
  • actually iam using the stored procedure " sp_send_email" is not sending email.can you please help me. – superbun1 Sep 07 '11 at 19:43
  • 1
    Is there a particular error message that occurs? Did you create a valid profile? Are you using the profile when calling the procedure? Did you *test* the profile? What SMTP server has the account been set to use? Does it allow traffic? What appears in the database mail log (you may have to ask your DBA for that as well, but it is in Object Explorer > Management > right-click Database Mail > View Database Mail Log)? I suggest you create a new question and have these answers as part of the question. Nobody is going to be able to solve "is not sending email" without prodding you for more details. – Aaron Bertrand Sep 07 '11 at 19:53