Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Friday, March 30, 2012

job_id not found

Hi
I am getting a wierd message when I click on the SnapShot Agent.
Error 14262, The Specified @.job_id (###) does not exist
any idea what could have caused this and what I can do to resolve this
thanks
P
Has someone deleted the job using the management folder in EM? Have a look
in the jobs subfolder and see if the snapshot job has been removed or not.
If it has, then the easiest solution is to set up the publication once
again.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Job to be run ever first for the previous calendar month

Hi!

I have a query that has to return bunch of data based on the calendar
month. I have to make sure that it will return data to me for 28 days
if it is February and for 31 if it is August(for example). I need to
be able to execute it every first of every month for the past 30, 31 or
28 days based on the calendar month. Is there a function or a stored
procedure that I can use to do that?

Thank you,
T.tolcis,

There might be a more elegant way, but this should work:

declare @.Now datetime
declare @.StartDate datetime
declare @.EndDate datetime

set @.Now = getdate()
if datepart(d, @.Now) = 1 -- only execute if it is the first day of the month
begin
-- to get start date, subtract one month from the date and remove the
time from the date
set @.StartDate = convert(varchar(15), dateadd (m, -1, @.now), 112)
-- to get end date, remove time from date
set @.EndDate = dateadd(m, 1, @.StartDate)
print cast(@.StartDate as char(25)) + cast(@.EndDate as char(25))
-- execute your code here using >= @.StartDate and < @.EndDate
end

-- Bill

"tolcis" <nytollydba@.gmail.comwrote in message
news:1169073028.098703.235980@.11g2000cwr.googlegro ups.com...

Quote:

Originally Posted by

Hi!
>
I have a query that has to return bunch of data based on the calendar
month. I have to make sure that it will return data to me for 28 days
if it is February and for 31 if it is August(for example). I need to
be able to execute it every first of every month for the past 30, 31 or
28 days based on the calendar month. Is there a function or a stored
procedure that I can use to do that?
>
Thank you,
T.
>

|||WHERE create_date < DATEADD(month,DATEDIFF(month, 0,getdate()),0)
AND create_date >= DATEADD(month,DATEDIFF(month, 0,getdate())-1,0)

Roy Harvey
Beacon Falls, CT

On 17 Jan 2007 14:30:29 -0800, "tolcis" <nytollydba@.gmail.comwrote:

Quote:

Originally Posted by

>Hi!
>
>I have a query that has to return bunch of data based on the calendar
>month. I have to make sure that it will return data to me for 28 days
>if it is February and for 31 if it is August(for example). I need to
>be able to execute it every first of every month for the past 30, 31 or
>28 days based on the calendar month. Is there a function or a stored
>procedure that I can use to do that?
>
>Thank you,
>T.

|||tocis,

Ignore the first post, this is better. Schedule your job to be run on the
first of every month. This will give you the prior month date range for any
date, not just the 1st. This way if the job fails you can also run it on the
2nd, 3rd, etc.

declare @.Now datetime
declare @.StartDate datetime
declare @.EndDate datetime

set @.Now = getdate()

-- to get end date, subtract days to get to get 1st of the month for any
date
set @.EndDate = dateadd(d, 1 - datepart(d,@.Now), @.Now)

-- remove the time portion
set @.EndDate = convert(char(12), @.EndDate, 112)

-- subtract a month for start date
set @.StartDate = dateadd(m, -1, @.EndDate)
print cast(@.StartDate as char(25)) + cast(@.EndDate as char(25))
-- execute your code here using >= @.StartDate and < @.EndDate

-- Bill

"AlterEgo" <alterego55@.dslextreme.comwrote in message
news:12qte0qjqivt0ae@.corp.supernews.com...

Quote:

Originally Posted by

tolcis,
>
There might be a more elegant way, but this should work:
>
declare @.Now datetime
declare @.StartDate datetime
declare @.EndDate datetime
>
set @.Now = getdate()
if datepart(d, @.Now) = 1 -- only execute if it is the first day of the
month
begin
-- to get start date, subtract one month from the date and remove the
time from the date
set @.StartDate = convert(varchar(15), dateadd (m, -1, @.now), 112)
-- to get end date, remove time from date
set @.EndDate = dateadd(m, 1, @.StartDate)
print cast(@.StartDate as char(25)) + cast(@.EndDate as char(25))
-- execute your code here using >= @.StartDate and < @.EndDate
end
>
-- Bill
>
"tolcis" <nytollydba@.gmail.comwrote in message
news:1169073028.098703.235980@.11g2000cwr.googlegro ups.com...

Quote:

Originally Posted by

>Hi!
>>
>I have a query that has to return bunch of data based on the calendar
>month. I have to make sure that it will return data to me for 28 days
>if it is February and for 31 if it is August(for example). I need to
>be able to execute it every first of every month for the past 30, 31 or
>28 days based on the calendar month. Is there a function or a stored
>procedure that I can use to do that?
>>
>Thank you,
>T.
>>


>
>

|||Roy,

Wya cool, did not know this!

-- Bill

"Roy Harvey" <roy_harvey@.snet.netwrote in message
news:vietq2l4344pq52plgrnael566amuu5pfb@.4ax.com...

Quote:

Originally Posted by

WHERE create_date < DATEADD(month,DATEDIFF(month, 0,getdate()),0)
AND create_date >= DATEADD(month,DATEDIFF(month, 0,getdate())-1,0)
>
Roy Harvey
Beacon Falls, CT
>
On 17 Jan 2007 14:30:29 -0800, "tolcis" <nytollydba@.gmail.comwrote:
>

Quote:

Originally Posted by

>>Hi!
>>
>>I have a query that has to return bunch of data based on the calendar
>>month. I have to make sure that it will return data to me for 28 days
>>if it is February and for 31 if it is August(for example). I need to
>>be able to execute it every first of every month for the past 30, 31 or
>>28 days based on the calendar month. Is there a function or a stored
>>procedure that I can use to do that?
>>
>>Thank you,
>>T.

|||Thanks. Works great.

Roy Harvey wrote:

Quote:

Originally Posted by

WHERE create_date < DATEADD(month,DATEDIFF(month, 0,getdate()),0)
AND create_date >= DATEADD(month,DATEDIFF(month, 0,getdate())-1,0)
>
Roy Harvey
Beacon Falls, CT
>
On 17 Jan 2007 14:30:29 -0800, "tolcis" <nytollydba@.gmail.comwrote:
>

Quote:

Originally Posted by

Hi!

I have a query that has to return bunch of data based on the calendar
month. I have to make sure that it will return data to me for 28 days
if it is February and for 31 if it is August(for example). I need to
be able to execute it every first of every month for the past 30, 31 or
28 days based on the calendar month. Is there a function or a stored
procedure that I can use to do that?

Thank you,
T.

sql

Monday, March 19, 2012

Job History hangs Enterprise Manager

Hi
I am not sure about your particular problem you may want to use SQL Profiler
to check out what SQL it is running and/or run sp_help_jobhistory from Query
Analyser. If you have a very long job history you could run
sp_purge_jobhistory to remove it.
Other things you may want to do is to run DBCC CHECKDB on MSDB.
John
"Bri" wrote:

> Hi
> I have Enterprise Manager on my local machine and administer a server from
> it. When I go to jobs and right click and choose view job history I get an
> hour glass and then EM Hangs and also pretty much kills my machine.
> Has this happened to anyone else? Is there a reason and/or fix for it?
> It only seems to happen on one server and I administer several others from
> my machine with no problem. I am running SQL Server 2000 SP4
> I have google but couldn't find anything helpfull.
> Thanks
>Hi
I have Enterprise Manager on my local machine and administer a server from
it. When I go to jobs and right click and choose view job history I get an
hour glass and then EM Hangs and also pretty much kills my machine.
Has this happened to anyone else? Is there a reason and/or fix for it?
It only seems to happen on one server and I administer several others from
my machine with no problem. I am running SQL Server 2000 SP4
I have google but couldn't find anything helpfull.
Thanks|||Hi
I am not sure about your particular problem you may want to use SQL Profiler
to check out what SQL it is running and/or run sp_help_jobhistory from Query
Analyser. If you have a very long job history you could run
sp_purge_jobhistory to remove it.
Other things you may want to do is to run DBCC CHECKDB on MSDB.
John
"Bri" wrote:

> Hi
> I have Enterprise Manager on my local machine and administer a server from
> it. When I go to jobs and right click and choose view job history I get an
> hour glass and then EM Hangs and also pretty much kills my machine.
> Has this happened to anyone else? Is there a reason and/or fix for it?
> It only seems to happen on one server and I administer several others from
> my machine with no problem. I am running SQL Server 2000 SP4
> I have google but couldn't find anything helpfull.
> Thanks
>|||Bri wrote:
> Hi
> I have Enterprise Manager on my local machine and administer a server from
> it. When I go to jobs and right click and choose view job history I get an
> hour glass and then EM Hangs and also pretty much kills my machine.
> Has this happened to anyone else? Is there a reason and/or fix for it?
> It only seems to happen on one server and I administer several others from
> my machine with no problem. I am running SQL Server 2000 SP4
> I have google but couldn't find anything helpfull.
> Thanks
>
When it "hangs", open up Query Analyzer and look at sysprocesses on the
server, see if there is something blocking you, or if there is a
waittype specified for your spid. You could just have an exceptionally
long history for the given job.|||Bri wrote:
> Hi
> I have Enterprise Manager on my local machine and administer a server from
> it. When I go to jobs and right click and choose view job history I get an
> hour glass and then EM Hangs and also pretty much kills my machine.
> Has this happened to anyone else? Is there a reason and/or fix for it?
> It only seems to happen on one server and I administer several others from
> my machine with no problem. I am running SQL Server 2000 SP4
> I have google but couldn't find anything helpfull.
> Thanks
>
When it "hangs", open up Query Analyzer and look at sysprocesses on the
server, see if there is something blocking you, or if there is a
waittype specified for your spid. You could just have an exceptionally
long history for the given job.

Friday, March 9, 2012

job execution user change and ownership question

Hi
I am running my sql server 2000 server and agent as a service with domain
admin user.
Is this recommended?
Who should be the job owner? sa or application user?
Can the job be run by any other user other than the user who started the
sqlserver agent.
TKS
MangeshHi
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in
message news:907D7E49-4B58-4D9F-B3D4-149D45B9B94C@.microsoft.com...
> Hi
> I am running my sql server 2000 server and agent as a service with domain
> admin user.
> Is this recommended?
No! A domain admin is over privileged, restrict the account to what you need
to do.
Check out the requirements for this account at
http://msdn.microsoft.com/library/d.../>
ew_6k1f.asp
You may also want to read some of the information on:
http://www.sqlsecurity.com/DesktopD...index=0&tabid=1

> Who should be the job owner? sa or application user?
This will depend what the job does e.g if you need to restrict the job to
the privleges of the application user or if the job needs higher
permissions.

> Can the job be run by any other user other than the user who started the
> sqlserver agent.
>
Yes, look at sp_start_job to run the job at a non-scheduled time. Check out
books online for information about the context in which jobs are run.

>
> TKS
> Mangesh
John

job execution user change and ownership question

Hi
I am running my sql server 2000 server and agent as a service with domain
admin user.
Is this recommended?
Who should be the job owner? sa or application user?
Can the job be run by any other user other than the user who started the
sqlserver agent.
TKS
Mangesh
Hi
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in
message news:907D7E49-4B58-4D9F-B3D4-149D45B9B94C@.microsoft.com...
> Hi
> I am running my sql server 2000 server and agent as a service with domain
> admin user.
> Is this recommended?
No! A domain admin is over privileged, restrict the account to what you need
to do.
Check out the requirements for this account at
http://msdn.microsoft.com/library/de...rview_6k1f.asp
You may also want to read some of the information on:
http://www.sqlsecurity.com/DesktopDe...ndex=0&tabid=1

> Who should be the job owner? sa or application user?
This will depend what the job does e.g if you need to restrict the job to
the privleges of the application user or if the job needs higher
permissions.

> Can the job be run by any other user other than the user who started the
> sqlserver agent.
>
Yes, look at sp_start_job to run the job at a non-scheduled time. Check out
books online for information about the context in which jobs are run.

>
> TKS
> Mangesh
John

Wednesday, March 7, 2012

Job Exe calling MAPI object, fails

Hi!
I have got a VB.NET exe which is using MAPI object to read the emails.
Now, the exe works excellent if I execute it independently. However, my
requirement is, I have to call this exe through SQL Jobs (SQL Agent). Now,
when I do that way, the MAPI logon fails, everytime.
It is giving me this error:
[Collaboration Data Objects - [MAPI_E_LOGON_FAILED(80040111)]]
Please help!
Regards,
Sachin VaishnavThe SQL agent will use a MAPI profile associated with the SQL Agent service
login, not the currently logged-in console user. Log in to the console
using the SQL Agent service account and create the correct MAPI profile.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
message news:01864869-CAC2-45C9-A88A-6E8102BF1F70@.microsoft.com...
> Hi!
> I have got a VB.NET exe which is using MAPI object to read the emails.
> Now, the exe works excellent if I execute it independently. However, my
> requirement is, I have to call this exe through SQL Jobs (SQL Agent). Now,
> when I do that way, the MAPI logon fails, everytime.
> It is giving me this error:
> [Collaboration Data Objects - [MAPI_E_LOGON_FAILED(80040111)]]
> Please help!
> Regards,
> Sachin Vaishnav

Job Exe calling MAPI object, fails

Hi!
I have got a VB.NET exe which is using MAPI object to read the emails.
Now, the exe works excellent if I execute it independently. However, my
requirement is, I have to call this exe through SQL Jobs (SQL Agent). Now,
when I do that way, the MAPI logon fails, everytime.
It is giving me this error:
[Collaboration Data Objects - [MAPI_E_LOGON_FAILED(80040111)]]
Please help!
Regards,
Sachin Vaishnav
The SQL agent will use a MAPI profile associated with the SQL Agent service
login, not the currently logged-in console user. Log in to the console
using the SQL Agent service account and create the correct MAPI profile.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Sachin Vaishnav" <SachinVaishnav@.discussions.microsoft.com> wrote in
message news:01864869-CAC2-45C9-A88A-6E8102BF1F70@.microsoft.com...
> Hi!
> I have got a VB.NET exe which is using MAPI object to read the emails.
> Now, the exe works excellent if I execute it independently. However, my
> requirement is, I have to call this exe through SQL Jobs (SQL Agent). Now,
> when I do that way, the MAPI logon fails, everytime.
> It is giving me this error:
> [Collaboration Data Objects - [MAPI_E_LOGON_FAILED(80040111)]]
> Please help!
> Regards,
> Sachin Vaishnav

job email

hi
i'm new to sql administration.
the built in sp for email uses a single account to send email.
i have a table (fromEmail, fromName, toEmail, toName, subject,
content). the fromXXX fields are dynamic.
is there another sp that can send mail with these parameters?
how could i do this?
thanx
riyazwhat built in sp did you try?
sp_send_dbmail in sql server 2005 has a @.profile_name argument which is the
name of the profile to send the message from.
hth,
Cristian Babu
<rmanchu@.gmail.com> wrote in message
news:1147241986.934852.156770@.i40g2000cwc.googlegroups.com...
> hi
> i'm new to sql administration.
> the built in sp for email uses a single account to send email.
> i have a table (fromEmail, fromName, toEmail, toName, subject,
> content). the fromXXX fields are dynamic.
> is there another sp that can send mail with these parameters?
> how could i do this?
> thanx
> riyaz
>|||One that I use ,(it's not built in you will have to apply, straightforward)
is XPSMTP on .http://www.sqldev.net/xp/xpsmtp.htm
--
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
___________________________________
<rmanchu@.gmail.com> wrote in message
news:1147241986.934852.156770@.i40g2000cwc.googlegroups.com...
> hi
> i'm new to sql administration.
> the built in sp for email uses a single account to send email.
> i have a table (fromEmail, fromName, toEmail, toName, subject,
> content). the fromXXX fields are dynamic.
> is there another sp that can send mail with these parameters?
> how could i do this?
> thanx
> riyaz
>|||One that I use ,(it's not built in you will have to apply, straightforward)
is XPSMTP on .http://www.sqldev.net/xp/xpsmtp.htm
--
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
___________________________________
<rmanchu@.gmail.com> wrote in message
news:1147241986.934852.156770@.i40g2000cwc.googlegroups.com...
> hi
> i'm new to sql administration.
> the built in sp for email uses a single account to send email.
> i have a table (fromEmail, fromName, toEmail, toName, subject,
> content). the fromXXX fields are dynamic.
> is there another sp that can send mail with these parameters?
> how could i do this?
> thanx
> riyaz
>|||Jack Vamvas wrote:
> One that I use ,(it's not built in you will have to apply, straightforward
)
> is XPSMTP on .http://www.sqldev.net/xp/xpsmtp.htm
had a look. seems solid.
but how do i specify the name/email of the recipients? is this
possible? is there a format?
eg: John Doe <jdoe@.trademin.gov.mv>, Jane Doe <email>
thanx
riyaz