Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sqlpal2007
Posting Yak Master
200 Posts |
Posted - 2008-10-22 : 09:16:43
|
Hello All,I get an error when I use sp_send_maildb to execute sql query and attach results as a file. If I use databasename..ReplResults still I get the error.I replaced the query to select records from some other database it works fine. Following is my command. EXEC msdb.dbo.sp_send_dbmail @profile_name = 'Trackwise' , @recipients = N'neweamil@company.com' , @Query = 'SELECT * FROM ReplResults' , @Subject = N'DATA validation' , @attach_query_result_as_file = 1 , @query_result_width = 2000 Error:Msg 22050, Level 16, State 1, Line 0Error formatting query, probably invalid parametersMsg 14661, Level 16, State 1, Procedure sp_send_dbmail, Line 478Query execution failed: ?Msg 208, Level 16, State 1, Server US-PROD-DW03, Line 1Invalid object name 'ReplResults'.Please let me know if I am doing something wrong.Thanks,-P |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-10-22 : 18:00:53
|
quote: If I use databasename..ReplResults still I get the error.
Try databasename.schema.ReplResultswhere schema maybe DBOWebfredNo, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|
|
|