If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > One bit replacing

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-05-03, 07:29
mariaasl mariaasl is offline
Registered User
 
Join Date: Aug 2003
Posts: 9
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 04:20.
Reply With Quote
  #2 (permalink)  
Old 10-16-03, 13:09
ms_sql_dba ms_sql_dba is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 10-20-03, 08:59
mariaasl mariaasl is offline
Registered User
 
Join Date: Aug 2003
Posts: 9
Thanks!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On