views:

41

answers:

1

Hi,

I'm having issues with setting a string to sqlbinary or something like that.

Example:

The string comes from a csv file: 0x0000000001E5CFE7 It's read into string, but now I have to execute a stored procedure with the parameter timestamp, because it's an timestamp.

Does anyone have an idea for me how to set this.

+1  A: 

You can't set a timestamp in SQL Server - it is DB generated and only written to by SQL Server itself. Although it is semantically equivalent to a binary(8), you can't explicitly set the value, only read it.

You can compare a timestamp value directly to a variable or literal of type binary(8) however if that's what you're trying to do.

David M
It's not used to set the timestamp, but for validation if the row is not changed after data manipulation.So that isn't a problem.
MysticSlayer
Have edited post
David M