Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Running SQL queries & attach to email
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

6 Posts

Posted - 12/11/2012 :  06:51:33  Show Profile  Reply with Quote
Is there any Application to Running SQL queries & attach to email with scheduler .

Please support. Thanks

Ahmed Soliman

Flowing Fount of Yak Knowledge

United Kingdom
3385 Posts

Posted - 12/11/2012 :  07:11:37  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
Have a look at dbmail.

Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Flowing Fount of Yak Knowledge

United Kingdom
2179 Posts

Posted - 12/11/2012 :  07:17:26  Show Profile  Visit jackv's Homepage  Reply with Quote
SQL Server comes with Database Mail . Configure Database mail and then use the msdb.dbo.sp_send_dbmail stored procedure ,with SQL Server Agent . Here is an example of the built in stored procedure. Using the @attach_query_result_as_file will attach the query results

EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'Main',
@body = 'some body text',
@subject = 'some subject text' ,
@recipients = '',
@execute_query_database = 'MY_DB',
@attach_query_result_as_file = 1,
@query = 'EXEC mySp'

Jack Vamvas
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000