Showing posts with label entry. Show all posts
Showing posts with label entry. Show all posts

Monday, March 12, 2012

How to receive mails, when a record is entered into my error log table?

I'm using SQL Server 2000.

I want to receive a mail for every new entry, into my error log table. I want to receive the inserted value in the form of subject of the mail and some other text column's value as the body of the mail.

Plz. guide me.

Best Regards

Trinadh P.

SQLNS can certainly do this, but depending on your circumstances another technology - including Database Mail or an external SMTP XP - may be better suited for the task.

If you opt for the SQLNS route, take at look at one of the samples provided with the install and mimic one that uses the SQL Server Event Provider.

HTH....

Joe

Wednesday, March 7, 2012

how to read a 1204 and 1206 trace log entry

so i'm investigating deadlocks which occur on the database i am
responsible for. i've put in place a 1204 and 1206 trace, and now i'm
just curious how to interpret the findings. i have read the BOL section
on troubleshooting deadlocks, which list the entries for the 1204
trace, but they don't seem to map very well to what i'm seeing in the
actual log file. a few fields map, but several others are missing or
extra. so i have two preliminary questions:
(1) is it safe to post 1204 and 1206 log entries to usenet? i don't see
any data that looks at all sensitive or secure in the log entries, but
just thought i'd make sure.
(2) is this an appropriate group to post a sample log entry to ask how
it should be read? this is where i began the investigation, so it
seemed appropriate to continue it here.
thanks,
jasonHi Jason
Have you tried sp_blocker_pss80
http://support.microsoft.com/kb/271509/EN-US/
John
"jason" wrote:

> so i'm investigating deadlocks which occur on the database i am
> responsible for. i've put in place a 1204 and 1206 trace, and now i'm
> just curious how to interpret the findings. i have read the BOL section
> on troubleshooting deadlocks, which list the entries for the 1204
> trace, but they don't seem to map very well to what i'm seeing in the
> actual log file. a few fields map, but several others are missing or
> extra. so i have two preliminary questions:
> (1) is it safe to post 1204 and 1206 log entries to usenet? i don't see
> any data that looks at all sensitive or secure in the log entries, but
> just thought i'd make sure.
> (2) is this an appropriate group to post a sample log entry to ask how
> it should be read? this is where i began the investigation, so it
> seemed appropriate to continue it here.
> thanks,
> jason
>|||Thanks John, this looks like it could be very useful. I will read up on
it and give it a shot.
Jason

Sunday, February 19, 2012

How to query dates

How can I query date only in a where clause and not include the time part? When I use the where below if the time part of the date entry has past then the rows are not returned.

WHERE A.Selected=1 AND A.EndDate Is Null OR A.Enddate >= GETDATE()

Thanks,there are convert functions with codes like 410,411...etc am not xactly sure which one it is..may be if yo google around you can get the snippet of code...
another way you can also try


WHERE A.Selected=1 AND A.EndDate Is Null OR
(
datepart(m,A.Enddate) >= datepart(m,GETDATE()) and
datepart(d,A.Enddate) >= datepart(d,GETDATE()) and
datepart(y,A.Enddate) >= datepart(y,GETDATE())
)

hth