473,586 Members | 2,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Converting timestamp values from Varchar to varbinary(8)


I have been battling with this for days now. If you execute the SQL below
you will get the following result: 0x3078303030303 030, 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 @strMinTimestam p varchar(18)
declare @MinTimestamp varbinary(8)

set @strMinTimestam p = '0x000000001A01 7FD8'

set @MinTimestamp = convert(varbina ry(8), @strMinTimestam p)

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

thanks in advance!!

Jul 20 '05 #1
0 6178

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

Similar topics

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 possible. I have 2 tables, one called ACCOUNTS and one called STOCK. These tables have the usual ints, varchars, etc and have a timestamp field as...
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: <col1row1>col2row1</col1row1> <col1row2>col2row2</col1row2>
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 Member: Triangle Fraternity, Sports Car Club of America Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you...
by: Brian Tkatch | last post by:
I have a PROCEDURE that test other PROCEDUREs. Timings_Call ------------------ Id Group Name Text Timings_Log
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 represented by: char *go03_btag="10.10.2006"; SQLCODE = -180, SQLSTATE = 22008 MESSAGE: SQL0180N The syntax of the string representation of a...
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) NOT NULL, MIDDLE_NAME varchar(20), LAST_NAME varchar(20) NOT NULL, DATE_OF_BIRTH date NOT NULL, NATIONALITY varchar(20) ,
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 array and back to hex string thanks
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 different answer: # db2 "VALUES INTEGER(CHAR(1964-07-20))"
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 I pass the DbNull value to the Value property, the DbType of the DbParameter object is still string. If I try to write into a binary field (...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.