Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    9

    Unanswered: One byte replacing

    Hi all,

    I am working in VB6. How can I replace a first byte in GUID value with a constant?

    Thanks a lot for your help!
    Last edited by mariaasl; 10-07-03 at 05:20.

  2. #2
    Join Date
    Sep 2003
    Posts
    522
    Code:
    create table t1 (f1 uniqueidentifier, f2 char(1))
    go
    insert t1 values (newid(), 'A')
    go
    select * from t1 where f2 = 'A'
    go
    declare @s varchar(36)
    select @s = f1 from t1 where f2 = 'A'
    set @s = '1' + substring(@s, 2, 35)
    update t1 set f1 = @s where f2 = 'A'
    go
    select * from t1 where f2 = 'A'
    go
    drop table t1

  3. #3
    Join Date
    Aug 2003
    Posts
    9
    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •