• subscribe
April 24, 2003 12:00 AM

Working Around a Varchar Truncation

SQL Server Pro
InstantDoc ID #38422

I've noticed that when I pass varchar data in a parameter to the sp_OASetProperty stored procedure, SQL Server 7.0 truncates the data to 255 characters. For example, when I try to use Microsoft Collaboration Data Objects (CDO) to send a message, the body of the message is limited to 255 characters even though the @body variable is defined as varchar(8000). When I print the content of @body, the data is intact, but SQL Server sends only 255 characters. Does a workaround for the truncation problem exist?

The 255-character limit is based on the method that the sp_OA* stored procedures expose for passing data. You can work around the limit in one of two ways. You can pass the arguments through a table or external file: Simply create code that loops back into the database and reads all the data in the varchar column. Or you can define a wrapper that uses a method to accumulate the message text through repeated calls until the code returns an end-of-text or empty text delimiter.



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here
  • SP1?
    I know there is a SP1 for SQL 2008 R2 available....and there is a "feature pack" as well... ...
  • SQL database mirroring
    I have SQL Server 2008 R2 Enterprise 64bit on Windows 2008 R2 Enterprise 64bit.  Each SQL Server has...
  • Dell Compellent Disk Drive
    Does anybody has experience with Dell Compellent Disk Drive? Basically, this system manages all disk...
  • Sql server performance tuning
    I need to find a tool that help me to optimize sql server,queries,improve the performance and solve ...