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

sql server programming

group:

Error in stored procedure


Re: Error in stored procedure oj
5/3/2005 11:10:41 PM
sql server programming:
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­efault.aspx?scid=kb;en-us;1949­75


HOWTO: Access and Modify SQL Server BLOB Data by Using the ADO Stream Object
http://support.microsoft.com/d­efault.aspx?scid=kb;EN-US;q258­038


--






--
-oj



[quoted text, click to view]

Error in stored procedure Aleks
5/3/2005 11:20:20 PM
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

Re: Error in stored procedure Aleks
5/4/2005 7:55:54 AM
I get this with your link: The system cannot find the file specified.




[quoted text, click to view]

Re: Error in stored procedure Aleks
5/4/2005 7:57:23 AM
Also there is nothing on how to handle it with a stored procedure.

A


[quoted text, click to view]

Re: Error in stored procedure oj
5/4/2005 10:52:54 AM
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


[quoted text, click to view]

Re: Error in stored procedure oj
5/4/2005 10:56:47 AM
If you want to manipulate blob inside a sql stored proc, you would want to
use updatetext/writetext.

http://msdn.microsoft.com/library/en-us/tsqlref/ts_ua-uz_6i2c.asp

http://groups.google.co.uk/group/comp.databases.ms-sqlserver/browse_thread/thread/883132b5eee985e7/a79bfa4e2fbdf019?q=sqlserver+oj+updatetext&rnum=3#a79bfa4e2fbdf019

--
-oj


[quoted text, click to view]

AddThis Social Bookmark Button