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)
 TEXT FIELD

Author  Topic 

kapilarya
Yak Posting Veteran

86 Posts

Posted - 2005-08-21 : 07:41:31
is there any way by which i can crack from a text field to varchar where text field is storing more than 8000 characters and i want all the characters while cracking, it can be more than one varchar variable.

Kapil Arya

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-25 : 09:56:47
See if this helps you (to get first 8000 characters)

Declare @v varchar(8000)
Select @v=cast(textfield as varchar(8000)) from yourTable
Select @v

But I wonder if it is possible to get characters starts from 8001

Madhivanan

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

Kristen
Test

22859 Posts

Posted - 2005-08-25 : 10:32:16
SUBSTRING ?

Kristen
Go to Top of Page

VladRUS.ca
Starting Member

23 Posts

Posted - 2005-08-25 : 10:34:47
BOL: Maximum Capacity Specifications - Bytes per row = 8060


Check syscomments table and you will find how MS store text of big stored procedures in multiple rows
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-25 : 10:38:03
quote:
Originally posted by Kristen

SUBSTRING ?

Kristen


Well
To use substring you need to convert it into varchar where you can have maximum length of 8000. So still you can access only first 8000 characters. Am I wrong?

Madhivanan

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

Kristen
Test

22859 Posts

Posted - 2005-08-25 : 11:04:40
"Am I wrong?"

I believe so, but I thought that too until only the other day.

SELECT SUBSTRING(MyTextColumn, 8001, 16000 8000) FROM MyTable

should work ...

Kristen
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-26 : 01:09:21
Thats cool
I thought substring cannot be used directly without converting it to varchar so as in left or right. Thanks Kristen

Madhivanan

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

- Advertisement -