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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Need multiple Script result in one mail

Author  Topic 

kallushashi
Starting Member

11 Posts

Posted - 2012-10-24 : 10:09:12
Hi All,
i am facing a problem like i am having a 4 scripts for monitoring sql server like Script to check drive free space,Script to check backupstatus,Script to check databasestatus,Script to check unsuccessful jobs.And my problem is i want this all script reult in one mail can any one help me please it's urgent please

shashi

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-24 : 10:21:31
place each of results on to a temporary table with category to denote the type like disk space,backupststs etc. then use sp_send_dbmail and give select query from this table to include unified results in the mail

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

kallushashi
Starting Member

11 Posts

Posted - 2012-10-24 : 10:24:01
Actualy i need the following script to run every day on scheduled time and result to be mailed to the particular persons please give me the exact solution with step by step as i am new to sql server please

shashi
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-24 : 10:31:50
quote:
Originally posted by kallushashi

Actualy i need the following script to run every day on scheduled time and result to be mailed to the particular persons please give me the exact solution with step by step as i am new to sql server please

shashi


put it as a step in sql server agent job and schedule it to execute daily as per your schedule

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

kallushashi
Starting Member

11 Posts

Posted - 2012-10-25 : 09:50:21
Can you explain in detail as i told you i am new to sql server

shashi
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-25 : 10:10:50
see

http://databases.about.com/od/sqlserver/ss/sql_server_agent_3.htm

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

kallushashi
Starting Member

11 Posts

Posted - 2012-10-25 : 10:59:25
By that process the script scheduled for mentioned time i want the script to be executed and result to be mailed

shashi
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-25 : 11:21:03
quote:
Originally posted by kallushashi

By that process the script scheduled for mentioned time i want the script to be executed and result to be mailed

shashi


it will schedule and execute it automatically

for mail part you need to use sp_dend_dbmail as i suggested before

http://msdn.microsoft.com/en-us/library/ms190307.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -