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
 General SQL Server Forums
 New to SQL Server Programming
 Suggestion to use Text

Author  Topic 

requestor
Starting Member

17 Posts

Posted - 2007-10-21 : 07:03:58
Hai, This posting related to my previous posting. Updating Bulk record. Actully im writing SP for windows Services, which does bulk updating of records to Sql 2000.
In one point of time, i may recieve 2000 records for single update..So what i have done, im concatinating the values to be updated in string and passing the string..
But when i did the calcuation for 2000 records, the length of the character comes around 10000. So i cannot user Varchar to hold me concatinated value in SP. There is another datatype "Text" but im not sure abt that. For my requirment what is the data type can i go for.. if i can use "Text" how to declare that...Ordinary declaration gives me error..
Help pls

Kristen
Test

22859 Posts

Posted - 2007-10-21 : 07:10:48
You can Split a TEXT datatype, but its quite a lot more "painful" than splitting a Varchar.

Under SQL 2005 you can use Varchar(MAX) instead - and make a Split routine that can handle Varchar(MAX). There are performance penalties using Varchar(MAX) as a parameter to a Split routine, rather than Varchar, but for a bulk import that's probably not a concern.

Passing XML, rather than delimited string, might be a better route.

"This posting related to my previous posting"

Just so you know: That doesn't help me at all, I answer thousands of posts a month here, I don't read, or even remember, them all, nor have time to go hunt for them. Either post a Reply on that thread if its relevant, or a link to it please - or just start a new thread and a new question.

Kristen
Go to Top of Page

requestor
Starting Member

17 Posts

Posted - 2007-10-21 : 07:22:24
Hai Thanks for the reply. As im using sql server 2000 i cannot make use of this MAX.
Do u know, how can i declare the Text variable.

quote:
Originally posted by Kristen

You can Split a TEXT datatype, but its quite a lot more "painful" than splitting a Varchar.

Under SQL 2005 you can use Varchar(MAX) instead - and make a Split routine that can handle Varchar(MAX). There are performance penalties using Varchar(MAX) as a parameter to a Split routine, rather than Varchar, but for a bulk import that's probably not a concern.

Passing XML, rather than delimited string, might be a better route.

"This posting related to my previous posting"

Just so you know: That doesn't help me at all, I answer thousands of posts a month here, I don't read, or even remember, them all, nor have time to go hunt for them. Either post a Reply on that thread if its relevant, or a link to it please - or just start a new thread and a new question.

Kristen

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-21 : 13:39:21
See: http://weblogs.sqlteam.com/davidm/archive/2003/12/12/655.aspx

I've not tried it, but hopefully it will do what you want.

Kristen
Go to Top of Page
   

- Advertisement -