Passing large strings into a SQLServer stored proc

Results 1 to 2 of 2

Thread: Passing large strings into a SQLServer stored proc

  1. #1
    Kenyon Guest

    Default Passing large strings into a SQLServer stored proc

    I realize this in not pure ASP, but I thought some of you might have experience with SQL Server<BR><BR>I&#039m having problems passing large strings into my SQL Server stored procedures.<BR><BR>Say my large string is held in a variable: strLarge. The typical syntax for passing it into my stored procedure would be:<BR><BR>Exec storedProcName &#039strLarge&#039<BR><BR>Unfortunately, since my string has various characters, including single quotes, I have to pass it to the stored procedure as such:<BR><BR>Exec storedProcName [strLarge]<BR><BR>This is great, except when I try to excute this, a SQL Server error #103 is returned stating that my string is too long because it is more than 128 characters.<BR><BR>I&#039ve tried putting the following code in my stored procedure:<BR><BR>SET QUOTED_IDENTIFIER OFF<BR><BR>Unfortunately, that does not solve the problem.<BR><BR>Does anyone know of another way to pass in large variables to a stored procedure without using single quotes? If it helps, I am passing the variables into the stored procedure from an Active Server Page.

  2. #2
    Richard A. Lowe Guest

    Default RE: Passing large strings into a SQLServer stored

    Try escaping the quotes (just double them:)<BR><BR>mySQLString = Replace(mySQLString, "&#039", "&#039&#039")<BR><BR>or whatever the syntax is for the replace function - I&#039m really tired and can&#039t be sure :)<BR><BR>HTH<BR>Richard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts