Re: time

From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 07/26/04


Date: Mon, 26 Jul 2004 15:30:55 +0530

Hi,

You have to use the datatype "DATETIME" to store Date and Time. There is no
data type in SQL server which stores the time only. You can define the
column as DATETIME and while displaying you can use the CONVERT functions
and display the time only.

Sample:-

declare @k datetime
set @k=getdate()
select convert(char,@k,108)

Timestamp:-

Timestamp is not meant to store the time. It is used for version stamping
tables and will be unique inside a database. It is actually a automatically
generated binary value.

Note:-
The Transact-SQL timestamp data type is not the same as the timestamp data
type defined in the SQL-92 standard. The SQL-92 timestamp data type is
equivalent to the Transact-SQL datetime data type.

Thanks
Hari
MCDBA

"sara" <anonymous@discussions.microsoft.com> wrote in message
news:3b7f01c4725f$a8376a00$a501280a@phx.gbl...
> Hi
> i am new in mssql7.before i am using sybase and
> some of the tables having field type time.after
> convert to mssql7 i changed that field type as timestamp.
> i want to store time in that feild.For select and update
> query there was no prbm in sybase, but here it is showing
> error"The columns data type (columnname)requires the use
> of an embedded stmt" and while updating also error is
> coming,how can i solve this and store time in table.Please
> help
> thanks



Relevant Pages

  • Re: Linking a Foxpro Table
    ... DateTime Datatype For FoxPro ... Choose the Date data type to store dates without time values. ...
    (microsoft.public.access.externaldata)
  • Re: How to overcome very slight calculation error.
    ... Dim MyNumber As Single ... you can't store, or nor use "real" numbers, as they are a approximates. ... solution in this case is to use decimal number, or a data type of currency. ...
    (microsoft.public.access.modulesdaovba)
  • Re: How to get around row size limitation
    ... it's really the only way to store> 8k of data in a single ... > I have a table which has a number of large notes columns where users ... > collect large blobs of data (I hardly consider this a blob, ... Do I need to use the nvarchar or text data type and if so, ...
    (microsoft.public.sqlserver.programming)
  • Re: How to get around row size limitation
    ... > - store larger chunks in TEXT columns (which do not count toward row-size, ... >> I have a table which has a number of large notes columns where users ... >> collect large blobs of data (I hardly consider this a blob, ... Do I need to use the nvarchar or text data type and if so, ...
    (microsoft.public.sqlserver.programming)
  • Re: Cross platform password string encryption
    ... different microprocessors use different schemes for ... Languages: some languages are very specific about how they format and ... store various data types. ... format and store the same data type. ...
    (sci.crypt)