Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Varchar Limit of 255 characters

Posted on 1998-09-22
1
278 Views
Last Modified: 2010-03-19
Does anyone know a way around the size limit of 255 characters?  I've written a stored procedure with a parameter list.  The parameters are used to build a SQL statement and that statement is used in an EXECUTE.  The problem is that my SQL statements are usually longer than 255 characters.  Any way to get around that?
0
Comment
Question by:StangLady
1 Comment
 

Accepted Solution

by:
doubas earned 50 total points
ID: 1090220
hi stanglady-

although it may not be as elegant a solution as what you had hoped for, what you can do is use more than one variable to build your sql statement, and then concatenate them inside the exec:

   exec(@sql1 + @sql2 + @sql3 + ...) -- perfectly legal

this is perfectly legal, and i think it's the only way it can be done.  you can also use literals as well:

   exec("select * from mytable where " + @sqlWhere)

hth,
doug
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question