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 |
|
ramu143
Yak Posting Veteran
64 Posts |
Posted - 2008-09-27 : 00:18:18
|
| i have created one procedure name mohani want to job shedule this one out put is 5 columns very rare we are getting out put are we are gettig 0 rows effected the procedure is like below please modify this one if need and tell me how to job schedule this one.CREATE procedure MOHAN as begin insert into cdb (machineid,operatorout,devbname,minutes,noofcalls,ACD)select machineid,operatorout,devbname,minutes,noofcalls,(minutes*1.0/noofcalls) as ACDfrom(select machineid,operatorout,devbname,sum(talktime)/60 as minutes,count(*) as noofcalls from wholesale.margin.dbo.cdbwhere operatorout not like '%_in' and connectflag='1' and devbname like 'dac%' group by machineid,operatorout,devbname )torder by machineid,operatorout,devbnameselect * from CDB where ACD<1 and noofcalls>30 order by ACD ,noofcalls--- THIS IS THE OUT PUT I NEED TO GET IN JOB SHEDULE>end GO |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-27 : 01:48:49
|
| put the output in job schedule? what do you mean by that? can you elaborate?Also this is script library. Please post your questions in relevant forums. This forum is only for posting user created scripts. |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-09-27 : 10:31:34
|
| moved from script library._______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.0 out! |
 |
|
|
ramu143
Yak Posting Veteran
64 Posts |
Posted - 2008-09-29 : 00:09:18
|
| if i put this procedure in job schedules and once job runs the output should sent to theair mail id's |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-29 : 00:41:40
|
quote: Originally posted by ramu143 if i put this procedure in job schedules and once job runs the output should sent to theair mail id's
Just use sp_send_dbmail in procedure to send query results to user email ids. Look into books online for syntax and usage of sp_send_dbmail. |
 |
|
|
|
|
|
|
|