all groups > sql server programming > november 2005 >
You're in the

sql server programming

group:

Stuff byte to binary variable


Re: Stuff byte to binary variable Tom Moreau
11/19/2005 3:38:23 PM
sql server programming:
You'll have to use UPDATETEXT.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
[quoted text, click to view]
When I want to get paticular byte from binary/varbinary variable I use
'substring' function, but how to stuff byte on pointed position?

Re: Stuff byte to binary variable Steve Kass
11/19/2005 7:53:55 PM
Waldemar,

The answer you got suggested UPDATETEXT, but that is only
for types text, ntext, and image. For varbinary/binary, use assignment:

@v = substring(@v,1,@position-1) + @newbyte + substring(@v,@position+1,8000)

The STUFF function may also work, but it is documented as a
string function, not a binary/varbinary function, and may convert
parameters to string and back.

Steve Kass
Drew University

[quoted text, click to view]
Re: Stuff byte to binary variable Tom Moreau
11/19/2005 8:55:42 PM
Oh, OK. I thought it was a table column for some reason.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com

[quoted text, click to view]

Stuff byte to binary variable Waldemar Grzywiñski
11/19/2005 9:34:49 PM
When I want to get paticular byte from binary/varbinary variable I use
'substring' function, but how to stuff byte on pointed position?

Re: Stuff byte to binary variable Waldemar Grzywiñski
11/20/2005 1:43:27 AM
Ok ... but 'UPDATETEXT' concern table column, not variable. So should I
create temporaty table, insert variable and update table column by 'TEXTPTR'
pointer?
Doesn't easy way? Substring function give me easy 'GET' statement: 'set
@a=substring(@b,10,1)'. Doesn't exist symmetrical 'PUT'?


U¿ytkownik "Waldemar Grzywiñski" <waldemarg@autograf.pl> napisa³ w
wiadomo¶ci news:e565tiU7FHA.2012@TK2MSFTNGP14.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button