What Happens At Midnight ?

Oct 17, 2006

Everyday at just gone midnight, my MSSQL server won't accept connections. About 25 minutes later, it seems to be OK. There's no third party backup software running on this machine which is MSSQL server aware. Has anyone any suggestions as to why this might be happening ?

The client app trying to use the db reports

17/10/2006 00:02:04 Email2DBServer Cannot open database "Email2DB" requested by the login. The login failed. From OpenLocalDatabase

and there's an entry in the event log

Event Type: Failure Audit
Event Source: MSSQL$EMAIL2DB
Event Category: (4)
Event ID: 18456
Date: 17/10/2006
Time: 00:02:04
User: NAVIGATOR-BATH
avigator-service
Computer: NAVIGAT2A
Description:
Login failed for user 'NAVIGATOR-BATH
avigator-service'. [CLIENT: <local machine>]
Data:
0000: 18 48 00 00 0e 00 00 00 .H......
0008: 13 00 00 00 4e 00 41 00 ....N.A.
0010: 56 00 49 00 47 00 41 00 V.I.G.A.
0018: 54 00 32 00 41 00 5c 00 T.2.A..
0020: 45 00 4d 00 41 00 49 00 E.M.A.I.
0028: 4c 00 32 00 44 00 42 00 L.2.D.B.
0030: 00 00 07 00 00 00 6d 00 ......m.
0038: 61 00 73 00 74 00 65 00 a.s.t.e.
0040: 72 00 00 00 r...

View 11 Replies


ADVERTISEMENT

Need Help Getting The Day Shift After Midnight

Dec 2, 2006

Hello there,I am having a small problem which been challenging me for few days andneed help or advice.I am trying to calculate the day-shift for employees based on the timethey started and finish working, I will only have 2 shifts 1 or 2 .Shift one changes based on the location however any thing else is shift2. The problem I am having is when someone signed in after midnight; Ineed to report his time under shift 2 for the previous day date. So ifhe signs at 12:30 AM on 12-12-2006, I need to report that as shift 2 on12-11-2006 and that’s where my problem is. Is there a way to subtractthe date by 1. I am using SQL Server and here is a simplified tables Iam working with:Employee tableEmployeID LocationID StartTime EndTime123 555 11:00:00 AM 3:00:00 PM183 559 7:00:00 AM 11:00:00 AM…Shift tableShiftNumber LocationID StartTime EndTime1 555 7:00:00AM 2:00:00PM2 555 2:00:00PM 12:00:00AM1 559 6:00:00AM 4:00:00PM…..So I am trying something likeCASE WHEN (select ShiftNumber FROM Shift WHERE LocationID=TR.LocationIDAND(TR.StartTime>=StartTimeANDTR.EndTime<= EndTime)) =1 THEN 1ELSEWHEN (select ShiftNumber FROM Shift WHERE LocationID=TR.LocationIDAND(TR.StartTime>=StartTimeANDTR.EndTime<= EndTime)) =2 THEN 2ELSE?????????????? NEED HELP HERE WHEN EMPLOYEE SIGN AFTER MIDNIGHTEND)FROMEmployee TRINNER JOIN Shift ON LocationID = TR.LocationID*** Sent via Developersdex http://www.developersdex.com ***

View 3 Replies View Related

Clear DB Fields At Midnight

Apr 14, 2004

I have a dataBase named pricesDB. I would like to clear all the prices column everyday at midnight.
How should i do that???

View 1 Replies View Related

Manipulating GetDate() To Start At Midnight Rather Than Now

Apr 29, 2008

Hi Folks,

I am trying to find the best way to use the getDate() function in SQL Server CE to return a date and time which starts at midnight rather than the value of now which getDate() returns.

When running getDate I get the value of 29/04/2008 10:48:33 returned, but I want to return 29/04/2008 00:00:00 instead.
The only way I can see to do this is like so:




Code Snippet

--SQL to get shifts for next 7 days.
select * from SHIFTS

where STARTDATE between
--Today at midnight 2008-04-29 00:00:00.000

(convert(datetime,

convert(nvarchar,(datepart(yyyy,getdate()))) + '/'

+

convert(nvarchar,(datepart(MM,getdate()))) + '/'

+

convert(nvarchar,(datepart(dd,getdate())))

))

and
--7 days from now at night 2008-05-05 00:00:00.000
(

convert( datetime,

convert(nvarchar,(datepart(yyyy,getdate()+6))) + '/'

+

convert(nvarchar,(datepart(MM,getdate()+6))) + '/'

+

convert(nvarchar,(datepart(dd,getdate()+6)))

))





Is there a better way to do this rather than this long winded method?

Thanks,

Morris

View 1 Replies View Related

Roll Date If Time Entered Is After Midnight

Feb 19, 2008

Hi again,
 In ASP.net, is there any elegant way to handle a set of time inserts from a form when the 2nd time is past midnight?
Specifically, I have a form with 2 textboxes on it (startTime and endTime) that are set up to accept time values (using AJAX MaskedEditExtender for formatting/validation - pretty cool). This data is posted to a sub that enters the data into a table (T_Details). However, I've noticed that the data inserted as part of the record (SQL field is smalldatetime) doesn't take into account the fact that a time value past 23:59:59 in the "endTime" textbox is a time on the next day - it simply rolls to an A.M. date for the same day as the date for the pre-midnight value from the "startTime" textbox. 
I'm sure that I can simply do some conditional coding and modify the date if necessary but is there a better way to do it? Thanks as always...this forum is a great resource

View 8 Replies View Related

SQL 2012 :: Getdate Pulls Time From Midnight To 23:59 Hours?

Jun 23, 2015

What is the proper way to ensure when pulling date between two getdates, that you include from midnight of the first getdate to 23:59 hours in the second getdate?

WD.WRKD_WORK_DATE
and WD.WRKD_WORK_DATE between DATEADD(DD, - 11, GETDATE())
and DATEADD(DD, - 5, GETDATE())

View 3 Replies View Related

Retrieving A Datetime With A Time Of Midnight (from A Typical Datetime)

Sep 7, 2007

Nothing difficult, I just need a way to generate a new datetime column based on the column [PostedDate], datetime. So basically I want to truncate the time. Thanks a lot.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved