Consultor Eletrônico



Kbase P58807: How do I see time portion of datetime or smalldatetime data type from MS SQL server?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Verified

GOAL:

How do I see time portion of datetime or smalldatetime data type from MS SQL server?

GOAL:

How does Progress SQL server dataserver manipulate SQL server datetime or smalldatetime data type?

FACT(s) (Environment):

MS SQL DataServer

FIX:

When creating DataServer Schema for the MS SQL Server it may happen that certain fields will have datetime or smalldatetime MS SQL Server data type. Progress will choose SQL_TIMESTAMP SQL-ODBC data type that maps to the Progress date data type.
This type (it will show as 'timestamp (date)' in the Data Dictionary) has the default format of 99/99/99.

During the data manipulation Progress will strip the time portion of the data in the field and it will show as Progress date. When creating or updating the record, the time will be set to "00:00:00".

If the same fields are being updated by other SQL server applications and time portion are populated by these application, dataserver schema holder can be updated to use timestamp (character) as the data type. Once the field is changed to timestamp(character), the time portion of the records from SQL server can be viewed from progress 4GL through dataserver.

For example, using winSQL

insert into dtproperties (id, property, version, somedate)
VALUES ( { ts '1956-05-07 10:41:37' } ) ;

Query from 4GL

FOR EACH dtproperties NO-LOCK BY STRING(somedate) :

Update from 4GL

CREATE dtproperties.
UPDATE
somedate = "1968-06-16 07:00:00" .

where the 'dtproperties' is the table name in MS SQL Server database.