﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / T-SQL (SS2K5)  / how can i use declare text in sql store procedure / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 26 May 2013 02:29:10 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: how can i use declare text in sql store procedure</title><link>http://www.sqlservercentral.com/Forums/Topic710944-338-1.aspx</link><description>[quote][b]pushpa.kumari (5/6/2009)[/b][hr]Hi,text datatype can have maximum length of 8000.I think you should break your dynamic query into 2-3 parts. [/quote]Text doesn't actually have a limit that low. Large Objects, LOB or BLOB for the binary large objects, are stored on disk, seperate from the table. However, use of the BLOB types are discouraged in 2005/2008.The OP found the right answer, using VARCHAR(MAX) is the way to go. If you were working with a binary it would be VARBINARY (MAX).</description><pubDate>Wed, 06 May 2009 07:11:27 GMT</pubDate><dc:creator>Grant Fritchey</dc:creator></item><item><title>RE: how can i use declare text in sql store procedure</title><link>http://www.sqlservercentral.com/Forums/Topic710944-338-1.aspx</link><description>nvarchar(max) solved my purpose , thanks a lot !</description><pubDate>Wed, 06 May 2009 06:34:47 GMT</pubDate><dc:creator>solutionsdxb</dc:creator></item><item><title>RE: how can i use declare text in sql store procedure</title><link>http://www.sqlservercentral.com/Forums/Topic710944-338-1.aspx</link><description>You cannot specify a column width on data type text.</description><pubDate>Wed, 06 May 2009 06:15:14 GMT</pubDate><dc:creator>Madhivanan-208264</dc:creator></item><item><title>RE: how can i use declare text in sql store procedure</title><link>http://www.sqlservercentral.com/Forums/Topic710944-338-1.aspx</link><description>Hi,text datatype can have maximum length of 8000.I think you should break your dynamic query into 2-3 parts. </description><pubDate>Wed, 06 May 2009 05:37:32 GMT</pubDate><dc:creator>pushpa.kumari</dc:creator></item><item><title>how can i use declare text in sql store procedure</title><link>http://www.sqlservercentral.com/Forums/Topic710944-338-1.aspx</link><description>Hi , I am using a store procedure where i am creating a query dynamic , but query size is increasing the limit of varchar(8000) size , how i can use the data type text in the store procedure to store the created query and then run using the command Exec(@query)I tried declaring it using the method below :DECLARE @Query text(16000)but giving me the error below : Msg 131, Level 15, State 3, Procedure csplitsubtable_loop, Line 11The size (16000) given to the type 'text' exceeds the maximum allowed for any data type (8000).</description><pubDate>Wed, 06 May 2009 05:25:34 GMT</pubDate><dc:creator>solutionsdxb</dc:creator></item></channel></rss>