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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-06-19 : 12:24:53
|
| caesar writes "I have this question i would like answered.I created a store proc in which i declare some variables, and one variable i would like create is a text variable, however SQL i get an error that i cannot use/create variable of text, ntext etc. Is there a way i can create a text variable within the procedure? Below is a sample store proc that i would like to create, however sql will moan with this kind of store proc:create procedure sp_Testas declare a text select a = field1* from table where field2 = 'james'Kindly appreciate your answer in advance!Caesar" |
|
|
macka
Posting Yak Master
162 Posts |
Posted - 2002-06-19 : 12:38:23
|
| Caesar,If you are performing this type of exact comparision then are you sure that the field column actually needs to be of type TEXT - can you use VARCHAR - this would give you up to 8000 characters - then you wouldn't have this issue as you could declare the variable as a VARCHAR.If the field has to be of type TEXT, then things aren't so good. SQL Server won't let you declare variables of type TEXT because the actual data may be held across seperate data pages.Have a look in Books Online under READTEXT for information on how to retrieve data from a TEXT field, one page at a time.Final thing I'd say is, take care to ensure that you also search where the page boundaries cross, otherwise you may run into trouble.macka. |
 |
|
|
|
|
|