Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.11.14;
Скачать: 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 вся ветка

Текущий архив: 2004.11.14;
Скачать: CL | DM;

Наверх




Память: 0.49 MB
Время: 0.045 c
14-1099036914
Baks
2004-10-29 12:01
2004.11.14
Мастера подскажите, помогите чайнику...


8-1092313698
serg128
2004-08-12 16:28
2004.11.14
Как записать звук (с микрофона) в AVI файл?


14-1098695699
DelphiLexx
2004-10-25 13:14
2004.11.14
tdump


14-1097689339
Knight
2004-10-13 21:42
2004.11.14
Люди... жените меня :)


9-1090532158
Sergeef
2004-07-23 01:35
2004.11.14
Доки по созданию игр на С++