Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Help Needed with TSQL

Author  Topic 

Needs_Help
Starting Member

2 Posts

Posted - 2006-08-23 : 15:45:03
Hello,

I am trying to use the solution posted at

http://weblogs.sqlteam.com/jeffs/archive/2004/03/22/1085.aspx

I have a page with 15 columns. The page works fine in the begining, but if I keep clicking the headers, the page crashes. To me it looks like the TSQL variable is running out of its capacity varchar(8000).

Can anyone has any more solution for the problem mentioned at

http://weblogs.sqlteam.com/jeffs/archive/2004/03/22/1085.aspx

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2006-08-24 : 04:42:08
The sql-query in jeffs procedure is a maximum of 1000 characters, but you can change it to 8000 if you want. What happens when you "keep clicking the headers"? You need to monitor the sql that is sent to the procedure...try to print the query out to the screen right before you send it to the procedure and see what is displayed each time you click the headers. I think this will give you the answer...

--
Lumbago
"Real programmers don't document, if it was hard to write it should be hard to understand"
Go to Top of Page

Needs_Help
Starting Member

2 Posts

Posted - 2006-08-28 : 11:54:14
Yes, I did print the SQL and it does get truncated after a certain point. Is there is another way to acheive the same thing as mentioned in the article without using Dynamic SQL ?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-28 : 11:59:20
To handle more than 8000 characters, Search for 8000 in this topic

http://sqlteam.com/forums/topic.asp?TOPIC_ID=55210


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2006-08-29 : 02:48:05
I'd say you need to redesign if your query is truncated after setting the variable to 8000 characters...passing a >8000-character sql to the database must be just horrible for performance.

--
Lumbago
"Real programmers don't document, if it was hard to write it should be hard to understand"
Go to Top of Page
   

- Advertisement -