RE: Question about logic and stored procs

RE: Question about logic and stored procs

 

  

Or just create a job and paste the code in and schedule that. Make sure
you select which database you want the job to run in.

-----Original Message-----
From: Swasey Steve D CTR 554 ELSG/FNF
[mailto:mssqldba-ezmlmshield-x26118758.[Email address protected]
Sent: 30 January 2007 14:42
To: LazyDBA Discussion
Subject: RE: Question about logic and stored procs


Jeff:

You can create a DTS package with an Execute SQL task and then schedule
the package to run at 12:01 AM every day.

Steve


-----Original Message-----
From: Carol Green
[mailto:mssqldba-ezmlmshield-x29820790.[Email address protected]
Sent: Tuesday, January 30, 2007 9:35 AM
To: LazyDBA Discussion
Subject: RE: Question about logic and stored procs

Try this:

If Datepart(d, getdate())= 1 insert into contributions (custnmbr,
periodid,year1) select custnmbr, month(getdate()),year(getdate())

EXEC myproc1
EXEC myproc2


-----Original Message-----
From: Jeff Metcalf [mailto:mssqldba-ezmlmshield-x33625425.[Email address
protected]
Sent: 30 January 2007 14:10
To: LazyDBA Discussion
Subject: Question about logic and stored procs


I have a large proc that loads a warehouse db every night. Right now on
the first of the month I manually run a proc to load the master tables
and I want to automate this also...it

If day(getdate())='1'
then
insert into contributions (custnmbr, periodid,year1)
select custnmbr, month(getdate()),year(getdate())
then run the rest of the procs
else if day(getdate())<>'1'
then just run the rest of the procs

Help, as always, is much appreciated.



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


This email and any files transmitted within it are private and
confidential.
If you are not the intended recipient, this email and any attachments
within it have been transmitted to you in error.
You are prohibited from using, copying, distributing or otherwise using
the information contained within this email.
Nothing in this email message amounts to a contractual or legal
commitment on the part of Optilan unless confirmed by a communication
signed on behalf of the company.
Any email cannot be guaranteed to be secure, error free or free from
viruses. Although every possible care is taken by Optilan, Optilan does
not accept any liability whatsoever for any loss or damage which may be
caused as a result of the transmission of this message by email.



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


MS Sql Server LazyDBA home page