Re: datetime problem
From: Aaron Bertrand - MVP (aaron_at_TRASHaspfaq.com)
Date: 05/07/04
- Next message: Anith Sen: "Re: Raising User Defined Errors"
- Previous message: BILLY BOB: "Can you join table variables?"
- In reply to: Owen: "Re: datetime problem"
- Next in thread: Michael Beck: "Re: datetime problem"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 7 May 2004 10:11:40 -0400
Thanks for the reprimand, but I did read all of your post. Recall that I
said "Sounds like"... in other words, you might have been mistaken, or
looking at the wrong column.
You forgot to mention what type of data connection you were using. I
assumed OLEDB, but if you are using an ODBC driver you might see truncation.
My suggestion: why are you making .Net send the current time at all? The
database knows the current time, and you can avoid a lot of problems by
removing those calculations from the app and improve efficiency by not
having to pass the additional data across the network. First, take out that
parameter statement. Next, remove the @date parameter from the stored
procedure, and remove the column from both sides of the insert statement.
Next, change the table definition:
ALTER TABLE tblEvents??? -- I guess once for each language
ALTER COLUMN [date] DATETIME NOT NULL DEFAULT GETDATE()
(Do you really need the seconds? Time of day even? Are you sure you want
to keep using reserved words for column names? And redundant prefixes like
tbl?)
How many language tables do you have?
-- Aaron Bertrand SQL Server MVP http://www.aspfaq.com/ "Owen" <anibal@prensa-latina.cu> wrote in message news:#ak8SrDNEHA.1644@TK2MSFTNGP09.phx.gbl... > You don't read my all post, because I wrote that the type in table is a > Datatime with length 8. > > thanks any way. > > "Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message > news:epsO3s7MEHA.2976@TK2MSFTNGP10.phx.gbl... > > Sounds like the [date] column (poor name choice, by the way) is of > > SMALLDATETIME type, which will round off any seconds/ms to the minute. > > > > -- > > Aaron Bertrand > > SQL Server MVP > > http://www.aspfaq.com/
- Next message: Anith Sen: "Re: Raising User Defined Errors"
- Previous message: BILLY BOB: "Can you join table variables?"
- In reply to: Owen: "Re: datetime problem"
- Next in thread: Michael Beck: "Re: datetime problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|