Solved

Varchar Limit of 255 characters

Posted on 1998-09-22
1
272 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

759 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now