Showing posts with label timestamp. Show all posts
Showing posts with label timestamp. Show all posts

Friday, February 24, 2012

Data types question - Varbinary and timestamps

Greetings once again SSIS friends,

I have some source tables which contain timestamp fields (that's timestamp data type not datetime). My dimension table holds the maximum timestamp value as a varbinary(8).

I want my package to have a variable that holds that value but I don't know which data type to use for this. The reason for this is because I want to use that variable to then retrieve all records from my source table that have a timestamp value greater than the value stored in the variable.

Please advise on what data type is suitable.

Thanks for your help in advance.

Greetings once again guys,

I found the following article which gives a workable solution to my problem, but I am still interested to find out the equivalent of timestamp data type in SSIS.

http://solidqualitylearning.com/blogs/erik/archive/2005/12/09/1499.aspx

|||

DT_BYTES

binary, varbinary, timestamp

binary, varbinary, timestamp

BigBinary, VarBinary

RAW

RAW

You will want to use DT_BYTES. See this article on MSDN.

http://msdn2.microsoft.com/en-us/library/ms141036.aspx

Does this answer your question?

Data Type timestamp

Hi,

I am a bit confused...

is the data type in sql express similar to DateTime? in other words can i convert this timestamp to DateTime or can i use this data type instead of the data type DateTime?

regards,

rnv

Even they store both 8 bytes, they are not the same, read more for this in the BOL.

timestamp

timestamp is a data type that exposes automatically generated binary numbers, which are guaranteed to be unique within a database. timestamp is used typically as a mechanism for version-stamping table rows. The storage size is 8 bytes.

Remarks

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.

http://msdn.microsoft.com/library/en-us/tsqlref/ts_ta-tz_6fn4.asp

If you want to use something like rowversioning, use ROWVERSION not datetime, as datetime has only the limitation to a precision of 3ms.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

thanks a lot.

|||Could you please mark the post as solved then, thanks.

Jens.