Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to obtain returned large string with sp_OAMethod?
Message
From
02/08/2006 07:04:23
 
 
To
31/07/2006 10:45:23
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01141810
Message ID:
01142339
Views:
12
>Hi,
I try to call a COM with sp_OACreate,sp_OAMethod etc. in my SP,the problem is how i can get the large string from the method of the COM, - the
returned value usually is a XML string, might be greater than varchar(8000).
>Tks in adv.

Can anybody help me? Maybe my description is too roughly,
I would paste a piece of sample codes of book online here,-
DECLARE @object int
DECLARE @hr int
DECLARE @property varchar(255)
DECLARE @return varchar(255)
DECLARE @src varchar(255), @desc varchar(255)

-- Create an object.
EXEC @hr = sp_OACreate 'SQLDMO.SQLServer', @object OUT
IF @hr <> 0
BEGIN
   EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT 
   SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
    RETURN
END

-- Call a method that returns a value.
EXEC @hr = sp_OAMethod @object, 'VerifyConnection', @return OUT
IF @hr <> 0
BEGIN
   EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT 
   SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
    RETURN
END
PRINT @return
Assuming returned value in @return be greater than 8k bytes,how can we obtain it?-that's my problem.
Steven
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform