I have a stored procedure that will copy data from one table to another, but
I am having problem doing so from a 'text' field from table 1 to table 2.
Here is my SP:
<%
Dim Addtemplates__FirmId
Addtemplates__FirmId = "4"
if(Session("FirmId") <> "") then Addtemplates__FirmId = Session("FirmId")
Dim Addtemplates__CaseId
Addtemplates__CaseId = "0"
if(Request.Querystring("caseid") <> "") then Addtemplates__CaseId =
Request.Querystring("caseid")
Dim Addtemplates__SecLtr
Addtemplates__SecLtr = "0"
if(Request.Querystring("caseid") <> "") then Addtemplates__SecLtr =
Request.Querystring("caseid")
Dim Addtemplates__LtrName
Addtemplates__LtrName = "0"
if(Templatesfiltered("LtrName") <> "") then Addtemplates__LtrName =
Templatesfiltered("LtrName")
Dim Addtemplates__LtrBody
Addtemplates__LtrBody = "0"
if(Templatesfiltered("LtrBody") <> "") then Addtemplates__LtrBody =
Templatesfiltered("LtrBody")
%>
<%
set Addtemplates = Server.CreateObject("ADODB.Command")
Addtemplates.ActiveConnection = MM_eimmigration_STRING
Addtemplates.CommandText = "dbo.Addtemplatestocase"
Addtemplates.Parameters.Append Addtemplates.CreateParameter("@.RETURN_VALUE",
3, 4)
Addtemplates.Parameters.Append Addtemplates.CreateParameter("@.FirmId", 3,
1,4,Addtemplates__FirmId)
Addtemplates.Parameters.Append Addtemplates.CreateParameter("@.CaseId", 3,
1,4,Addtemplates__CaseId)
Addtemplates.Parameters.Append Addtemplates.CreateParameter("@.SecLtr", 200,
1,50,Addtemplates__SecLtr)
Addtemplates.Parameters.Append Addtemplates.CreateParameter("@.LtrName", 200,
1,100,Addtemplates__LtrName)
Addtemplates.Parameters.Append Addtemplates.CreateParameter("@.LtrBody", 200,
1,16000,Addtemplates__LtrBody)
Addtemplates.CommandType = 4
Addtemplates.CommandTimeout = 0
Addtemplates.Prepared = true
Addtemplates.Execute()
%>
LtrBody is the field wich is 'text'. If I change it to be nvarchar 4000 it
works fine, but I need more space that is why I need it to be text.
This is the error:
Technical Information (for support personnel)
a.. Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
[Microsoft][ODBC SQL Server Driver]String data, right truncation
/BlueDotBeta2005/Intranet/Cases/Documents/AddtemplatesSP.asp, line 128
Line # 128 is: Addtemplates.Execute()
Any clues with the information above ?
AleksBlob must be handled differently than regular string. See these for some
info.
HOWTO: Read and Write BLOBs Using GetChunk and AppendChunk
http://support.microsoft.com/d_efau...b;en-us;1949_75
HOWTO: Access and Modify SQL Server BLOB Data by Using the ADO Stream Object
http://support.microsoft.com/d_efau...;EN-US;q258_038
--
-oj
"Aleks" <arkark2004@.hotmail.com> wrote in message
news:OFWS3gFUFHA.3280@.TK2MSFTNGP09.phx.gbl...
>I have a stored procedure that will copy data from one table to another,
>but I am having problem doing so from a 'text' field from table 1 to table
>2.
> Here is my SP:
> <%
> Dim Addtemplates__FirmId
> Addtemplates__FirmId = "4"
> if(Session("FirmId") <> "") then Addtemplates__FirmId = Session("FirmId")
> Dim Addtemplates__CaseId
> Addtemplates__CaseId = "0"
> if(Request.Querystring("caseid") <> "") then Addtemplates__CaseId =
> Request.Querystring("caseid")
> Dim Addtemplates__SecLtr
> Addtemplates__SecLtr = "0"
> if(Request.Querystring("caseid") <> "") then Addtemplates__SecLtr =
> Request.Querystring("caseid")
> Dim Addtemplates__LtrName
> Addtemplates__LtrName = "0"
> if(Templatesfiltered("LtrName") <> "") then Addtemplates__LtrName =
> Templatesfiltered("LtrName")
> Dim Addtemplates__LtrBody
> Addtemplates__LtrBody = "0"
> if(Templatesfiltered("LtrBody") <> "") then Addtemplates__LtrBody =
> Templatesfiltered("LtrBody")
> %>
> <%
> set Addtemplates = Server.CreateObject("ADODB.Command")
> Addtemplates.ActiveConnection = MM_eimmigration_STRING
> Addtemplates.CommandText = "dbo.Addtemplatestocase"
> Addtemplates.Parameters.Append
> Addtemplates.CreateParameter("@.RETURN_VALUE", 3, 4)
> Addtemplates.Parameters.Append Addtemplates.CreateParameter("@.FirmId", 3,
> 1,4,Addtemplates__FirmId)
> Addtemplates.Parameters.Append Addtemplates.CreateParameter("@.CaseId", 3,
> 1,4,Addtemplates__CaseId)
> Addtemplates.Parameters.Append Addtemplates.CreateParameter("@.SecLtr",
> 200, 1,50,Addtemplates__SecLtr)
> Addtemplates.Parameters.Append Addtemplates.CreateParameter("@.LtrName",
> 200, 1,100,Addtemplates__LtrName)
> Addtemplates.Parameters.Append Addtemplates.CreateParameter("@.LtrBody",
> 200, 1,16000,Addtemplates__LtrBody)
> Addtemplates.CommandType = 4
> Addtemplates.CommandTimeout = 0
> Addtemplates.Prepared = true
> Addtemplates.Execute()
> %>
>
> --
> LtrBody is the field wich is 'text'. If I change it to be nvarchar 4000 it
> works fine, but I need more space that is why I need it to be text.
> This is the error:
> Technical Information (for support personnel)
> a.. Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
> [Microsoft][ODBC SQL Server Driver]String data, right truncation
> /BlueDotBeta2005/Intranet/Cases/Documents/AddtemplatesSP.asp, line 128
> Line # 128 is: Addtemplates.Execute()
> Any clues with the information above ?
> Aleks
>|||I get this with your link: The system cannot find the file specified.
"oj" <nospam_ojngo@.home.com> wrote in message
news:OL2MYAHUFHA.260@.TK2MSFTNGP12.phx.gbl...
> Blob must be handled differently than regular string. See these for some
> info.
> HOWTO: Read and Write BLOBs Using GetChunk and AppendChunk
> http://support.microsoft.com/d_efau...b;en-us;1949_75
>
> HOWTO: Access and Modify SQL Server BLOB Data by Using the ADO Stream
> Object
> http://support.microsoft.com/d_efau...;EN-US;q258_038
>
> --
>
>
>
> --
> -oj
>
> "Aleks" <arkark2004@.hotmail.com> wrote in message
> news:OFWS3gFUFHA.3280@.TK2MSFTNGP09.phx.gbl...
>|||Also there is nothing on how to handle it with a stored procedure.
A
"oj" <nospam_ojngo@.home.com> wrote in message
news:OL2MYAHUFHA.260@.TK2MSFTNGP12.phx.gbl...
> Blob must be handled differently than regular string. See these for some
> info.
> HOWTO: Read and Write BLOBs Using GetChunk and AppendChunk
> http://support.microsoft.com/d_efau...b;en-us;1949_75
>
> HOWTO: Access and Modify SQL Server BLOB Data by Using the ADO Stream
> Object
> http://support.microsoft.com/d_efau...;EN-US;q258_038
>
> --
>
>
>
> --
> -oj
>
> "Aleks" <arkark2004@.hotmail.com> wrote in message
> news:OFWS3gFUFHA.3280@.TK2MSFTNGP09.phx.gbl...
>|||hmmm...blame it on copy & paste from archive via google. ;)
here are the corrected urls.
http://support.microsoft.com/kb/194975
http://support.microsoft.com/kb/258_038
-oj
"Aleks" <arkark2004@.hotmail.com> wrote in message
news:eo1h9AKUFHA.1796@.TK2MSFTNGP15.phx.gbl...
>I get this with your link: The system cannot find the file specified.
>
>
> "oj" <nospam_ojngo@.home.com> wrote in message
> news:OL2MYAHUFHA.260@.TK2MSFTNGP12.phx.gbl...
>|||If you want to manipulate blob inside a sql stored proc, you would want to
use updatetext/writetext.
http://msdn.microsoft.com/library/e..._ua-uz_6i2c.asp
9" target="_blank">http://groups.google.co.uk/group/co...fbdf01
9
-oj
"Aleks" <arkark2004@.hotmail.com> wrote in message
news:eL9prBKUFHA.2124@.TK2MSFTNGP14.phx.gbl...
> Also there is nothing on how to handle it with a stored procedure.
> A
>
> "oj" <nospam_ojngo@.home.com> wrote in message
> news:OL2MYAHUFHA.260@.TK2MSFTNGP12.phx.gbl...
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment