varchar to timestamp/bigint ?

  • I need to convert data in varchar to timestamp or bigint, is it possible ?

    Or else can i use any other technique.

    I tried using cast(varchat_value as timestamp) but it changes the value!

  • What does the VARCHAR data look like? BIGINT does not allow decimals.

    SQL's TIMESTAMP is really used to 'version stamp table rows'. Read up on this in the Books Online (BOL).

    If your VARCHAR column is strictly integers, try this (change 'mycolumn' to whatever your column name is):

    convert(bigint, mycolumn)

    Refer to the BOL for more information on the various datatypes.

    -SQLBill

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply