Вниз
Скачать: CL | DM;

MSSQL и SQLTimeStamp   Найти похожие ветки 

 
Санёк   (2004-10-12 13:27) [0]

Есть табличка

create table testdata
(
timestamp timestamp,
no1  int primary key,
no2 int,
st1 varchar(255)
)

FieldByName("timestamp").AsSQLTimeStamp

выдает ошибку "Cannot access field "timestamp" as type SQLTimeStamp"

Как можно прсмотреть данные поля "timestamp" таблички testdata


 
Ega23 ©   (2004-10-12 13:37) [1]

Переименуй поле.


 
Johnmen ©   (2004-10-12 13:37) [2]

In a CREATE TABLE or ALTER TABLE statement, you do not have to supply a column name for the timestamp data type:

CREATE TABLE ExampleTable (PriKey int PRIMARY KEY, timestamp)


А вообще, почитай BOL.


 
АлексейК   (2004-10-12 13:45) [3]

Переименуй
[timestamp]


 
Санёк   (2004-10-12 13:53) [4]

Я его переименовываю, всё равно не помогает, выдает ту же ошибку
"Cannot access field "mytimestamp" as type SQLTimeStamp"


 
MOA ©   (2004-10-12 13:58) [5]

QLTimeStamp - Это формат даты-времени.
В MSSQL тип данных timestamp - Это и не время, и не дата, а абстрактное число, гарантированно не повторяющееся в базе - используетсяЮ например, при репликации или при проверки не изменилась ли запись. Изменяется при каждой модификации записи. Есго смысл - "номер версии записи".
BOL:
....
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.
....
Microsoft® SQL Server™ 2000 introduces a rowversion synonym for the timestamp data type. Use rowversion instead of timestamp wherever possible in DDL statements. rowversion is subject to the behaviors of data type synonyms. For more information, see Data Type Synonyms.
...
value in the timestamp column is updated every time a row containing a timestamp column is inserted or updated. This property makes a timestamp column a poor candidate for keys, especially primary keys. Any update made to the row changes the timestamp value, thereby changing the key value.
...

Удачи!


 
Johnmen ©   (2004-10-12 14:00) [6]

>MOA ©   (12.10.04 13:58) [5]

Ну ты же видишь, чел не в себе, читать ничего не хочет...:)


 
Ega23 ©   (2004-10-12 14:02) [7]

datetime - реальный тип.


 
Санёк   (2004-10-12 14:05) [8]

Как можно прсмотреть данные поля "timestamp" таблички testdata?????


 
Ega23 ©   (2004-10-12 14:13) [9]

НУ ЧТО ТЫ ПРИСТАЛ??? ПОПРОБОВАТЬ РЕЛИГИЯ ЗАПРЕЩАЕТ?

select Cast(Cast(Cast(Cast(GetDate() as timestamp) as int) as varchar(10)) as varbinary)


 
MOA ©   (2004-10-12 14:19) [10]

>Как можно прсмотреть данные поля "timestamp" таблички testdata?????
BOL:
A nonnullable timestamp column is semantically equivalent to a binary(8) column. A nullable timestamp column is semantically equivalent to a varbinary(8) column.

Т.е. посмотреть-то можно, как 8-байтовой число, Int64 например.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.47 MB
Время: 0.024 c
3-1097723059
Marat
2004-10-14 07:04
2004.11.14
Запуск StoredProc


1-1099390060
Basil
2004-11-02 13:07
2004.11.14
Путь к папке


3-1097673643
inic
2004-10-13 17:20
2004.11.14
Table Is In Use


14-1098964710
Denis
2004-10-28 15:58
2004.11.14
Компютер не грузится с загрузочной дискеты


1-1099332413
Alexander Rudenko
2004-11-01 21:06
2004.11.14
Как мне получить PDB файл для делфи-приложения




   Наверх