Need urgent help on uploading very long string datatype to sql 2000

  • hi, i need some help here..

    can someone show me a working example on how to use the command object to send very long string datatype to sql 2000? The very long string is actually an xml document. command object is from ado2.7 Using asp2.0

    It works perfectly well on an ODBC connection, but once i changed it to sqloledb... it truncates the string to abt 100 i think!

    here is the snippet of the code

    Set xmlDoc=Server.CreateObject("Microsoft.XMLDOM")

    'load xml document into the xmldoc instance

    set cm = Server.CreateObject("ADODB.Command")

    cm.ActiveConnection = pubsDSN

    cm.CommandText = "sp_insertXML"

    cm.CommandType = 4

    set p = cm.Parameters

    p.Append cm.CreateParameter("RETURN_VALUE", adInteger, adParamReturnValue, 4)

    p.Append cm.CreateParameter("@strXML",adLongVarChar,adParamInput, len(xmlDoc.xml))

    p.Item("@strXML").AppendChunk xmlDoc.xml

    cm.Execute

  • Anyone? pls pls... very urgent

  • It doesn't seem to be a SQL issue, sounds like a sqloledb issue since it worked in ODBC.  I don't see any obvious problems with your code, but I'm no expert.

    Yukon has an xml datatype, but that doesn't help much!

    Really, if you want to store a string longer than 8000 characters you need to use the "text" datatype.  And you can't have a text data type variable, so using procs is out of the question.

    cl 

    Signature is NULL

  • What language are you using?  On SQL 2k you should be able to use a text parameter and a text column type.

  • SQL2K does not allow local variables of text type.

    declare @test-2 text

     

    Signature is NULL

  • Yes, but

    CREATE PROCEDURE updatePage

    <snip>

     @strBody text,

    <snip>

    AS

    UPDATE Page

    SET 

    <snip>

     Page.strBody = @strBody,

    <snip>

    WHERE

     Page.intPageId = @intPageId

    GO

    would (does) work fine...

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply