Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
create table my_comments (pkid int not null identity(1,1), comments text)
GO
set nocount on
declare @ptrval binary(16),
@current_comment_len int,
@new_comment varchar(8000),
@pkid int
select @pkid = 1 --or whatever you need it to be to test
select @new_comment = 'this is my new comment'
if exists (select * from my_comments where pkid = @pkid)
begin
select @current_comment_len = datalength(comments)
from my_comments
where pkid = @pkid
select @ptrval = textptr(comments)
from my_comments
where pkid = @pkid
updatetext my_comments.comments @ptrval @current_comment_len 0 @new_comment
end
else
begin
insert into my_comments (comments) values (@new_comment)
end
set nocount off
select *
from my_comments
where pkid = @pkid