March 4, 2011 at 7:47 am
Also, i want the results in body , not in as an attachment.
Thanks.
Regards,
Sushant
Regards
Sushant Kumar
MCTS,MCP
March 4, 2011 at 7:50 am
SKYBVI (3/4/2011)
Also, i want the results in body , not in as an attachment.Thanks.
Regards,
Sushant
please try both code snippets i pasted; one does exactly what you are asking by putting a query in the email body, the other does it as an attachment.
Lowell
March 4, 2011 at 7:51 am
SKYBVI (3/4/2011)
Also, i want the results in body , not in as an attachment.Thanks.
Regards,
Sushant
Sushant, if you look up sp_send_dbmail in BOL (Books Online, SQL Server's help) you will find the meaning of every single parameter.
I know that asking here and being spoon-fed is much easier, but this way you hardly learn something.
The parameter you're looking for is this one:
@attach_query_result_as_file
-- Gianluca Sartori
March 4, 2011 at 7:56 am
Gianluca Sartori (3/4/2011)
SKYBVI (3/4/2011)
Also, i want the results in body , not in as an attachment.Thanks.
Regards,
Sushant
Sushant, if you look up sp_send_dbmail in BOL (Books Online, SQL Server's help) you will find the meaning of every single parameter.
I know that asking here and being spoon-fed is much easier, but this way you hardly learn something.
The parameter you're looking for is this one:
@attach_query_result_as_file
I am not getting spoon fed, but iam having errors evertime i run the code, thts why , i want to know.
OKay, I will look at the parameter too..
Regards,
Sushant
Regards
Sushant Kumar
MCTS,MCP
March 4, 2011 at 8:35 am
OK ..
Now when i run hte code there is an error in hte line below:-
LEFT(LTRIM(RTRIM(IM.ITEMNMBR)), (CHARINDEX('-', LTRIM(RTRIM(IM.ITEMNMBR))) - 1)),
The error says :-
Incorrect syntax near '-'.
BUT when i run this code(t-sql) separetly, it runs fine...
Wondering..
Regards,
Sushant
Regards
Sushant Kumar
MCTS,MCP
March 4, 2011 at 8:38 am
if we are going to help with syntax, you have to paste the entire script you are trying to use.
remember we are not standing in your cubicle looking over your shoulder. we cna see only what you report here; everything you've posted so far is disjointed, or comments like "it doesn't work"
help us help you.
SSMS is kind enough to tell you the error and line number, usually that is enough to do it yourself, but if you are stuck, show us the entire code block.
Lowell
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply