﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / Using Varchar(max) to add to a field? / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 19 Jun 2013 11:52:53 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Using Varchar(max) to add to a field?</title><link>http://www.sqlservercentral.com/Forums/Topic1400544-391-1.aspx</link><description>turns out what you suggested did work after all, I'd like to thank you for your help</description><pubDate>Thu, 27 Dec 2012 04:21:46 GMT</pubDate><dc:creator>mick burden</dc:creator></item><item><title>RE: Using Varchar(max) to add to a field?</title><link>http://www.sqlservercentral.com/Forums/Topic1400544-391-1.aspx</link><description>Post your code with the varchar(max) used and post the exact error message</description><pubDate>Thu, 27 Dec 2012 04:12:37 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: Using Varchar(max) to add to a field?</title><link>http://www.sqlservercentral.com/Forums/Topic1400544-391-1.aspx</link><description>[quote][b]GilaMonster (12/27/2012)[/b][hr]You shouldn't be using TEXT in the first place, it's an old SQL 2000 data type, included only for backward compatibility. Use Varchar(max)[/quote]Varchar(Max) isn't allowed in my situation either</description><pubDate>Thu, 27 Dec 2012 04:04:12 GMT</pubDate><dc:creator>mick burden</dc:creator></item><item><title>RE: Using Varchar(max) to add to a field?</title><link>http://www.sqlservercentral.com/Forums/Topic1400544-391-1.aspx</link><description>You shouldn't be using TEXT in the first place, it's an old SQL 2000 data type, included only for backward compatibility. Use Varchar(max)</description><pubDate>Thu, 27 Dec 2012 04:01:52 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>Using Varchar(max) to add to a field?</title><link>http://www.sqlservercentral.com/Forums/Topic1400544-391-1.aspx</link><description>Merry Holidays everyone, I've created a basic table which includes a text field. I then created a SP which basically read the text field and then added to the same field, the problem is I get an error that says I can't use TEXT or Varchar(Max), is there a way round this?Table[code]CREATE TABLE KLN(RecId INT IDENTITY(1,1) PRIMARY KEY CLUSTERED,Dte DATETIME,machineid VARCHAR(50),Userid VARCHAR(50),memo text)[/code]Stored Procedure[code]CREATE  PROCEDURE [dbo].[Save_kln]@sDte as datetime,@smachineid as varchar(50),@sUserid as varchar(50),@smemo as textASDECLARE @sRESULTS varchar(MAX)if exists (select * from [kln] where [dte] = @sdte and Userid = @Suserid)beginset @sRESULTS = (select memo from [kln] where [dte] = @sdte and Userid = @Suserid)update [kln] set memo = @sRESULTS + @smemo where [dte] = @sdte and Userid = @SuseridendelsebeginINSERT INTO [kln] (dte,machineid,userid,memo) VALUES (@sdte,@smachineid,@suserid,@smemo)end[/code]</description><pubDate>Thu, 27 Dec 2012 03:56:52 GMT</pubDate><dc:creator>mick burden</dc:creator></item></channel></rss>