473,406 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Converting timestamp values from Varchar to varbinary(8)

Hi,

I have been battling with this for days now. If you execute the SQL below
you will get the following result: 0x3078303030303030, which is incorrect.
It looks like the conversion is more literal than I am wanting. Does anybody
know the correct way to convert a timestamp that has been stored as a char
type, back into a varbinary(8)? (vb(8) is the suggested data type for
storing timestamps)

==============================
declare @strMinTimestamp varchar(18)
declare @MinTimestamp varbinary(8)

set @strMinTimestamp = '0x000000001A017FD8'

set @MinTimestamp = convert(varbinary(8), @strMinTimestamp)

select @MinTimestamp
==============================

thanks in advance!!

Eugene
Jul 20 '05 #1
0 6132

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Astra | last post by:
Hi All I know an SQL Server timestamp seems to be as useful as rocking horse for show jumping, but I'm hoping you know a 'fudge' to get me round a problem or at least confirm that it isn't...
12
by: adrianca | last post by:
Hi All, If have a sql table with 2 columns and 2 rows with values ,]. Using t-SQL with "for xml" How can i create a xml where the cell values (not column names) appear as elements? eg:...
6
by: Jim C. Nasby | last post by:
Is there any reason why there isn't a predefined cast to go from a timestamp to a varchar? Is there a reason not to add one? -- Jim C. Nasby, Database Consultant jim@nasby.net...
16
by: Brian Tkatch | last post by:
I have a PROCEDURE that test other PROCEDUREs. Timings_Call ------------------ Id Group Name Text Timings_Log
2
by: klaus.schu | last post by:
I just receive an error during my CLI ODBC insert statement: INSERT INTO (.....) VALUES (?, ?, ?, TIMESTAMP( CAST(? AS VARCHAR(10)),'00:00:00'), ?, ?, ?, ?)"; the ? in the CAST( ) Statement is...
4
by: praveena mani | last post by:
how to insert values in this table for these two timestamps??? create table s_details( SELECT_ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, TITLE varchar(4) NOT NULL, FIRST_NAME varchar(20)...
0
by: Analizer1 | last post by:
can you conver a Varbinary to varchar declare @sid varbinary(85) select @sid = suser_sid("mydomain\mynam") // how to convert the sid to a string or do i need to //convert it in code to byte...
5
by: Hemant Shah | last post by:
Folks, How can I convert date/time/timestamp to an integer? According to UDB 8.1 docs that I have, INTEGER('1964-07-20') should return 19640720, but when I run the SQL statement I get...
0
by: Martin Horst | last post by:
Hi, I've got a problem with SQL update statements when I pass null values (or better let's say DbNull values) to a DbParameter derived class (in my case, I'm using an SQL Server database). When...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.