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
 SQL Server Development (2000)
 setting a value to ntext parameter

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2008-09-15 : 03:43:55
i wanted to use ntext parameter to set a value from sql2000.
beacuse i wasn't able to declare on ntext i wrote it in the beggining of the Stored Procedure as a passed value.
then using a cursor i set the value.
the problem is when i try to do :

set @res=substring(@res,CHARINDEX('|',@res)+1,DATALENGTH(@res))
or
SELECT @res=substring(@res,CHARINDEX('|',@res)+1,DATALENGTH(@res))

and i get a message that ntext can't be set- is there a way to bypass it?thnaks
peleg


Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-15 : 03:56:08
why are you still setting value to variable? cant you directly use parameter instead?
Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2008-09-15 : 06:48:16
i didnt understand what you execlly mean
can ypu explan pleasE?

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-15 : 06:58:27
quote:
Originally posted by pelegk2

i didnt understand what you execlly mean
can ypu explan pleasE?

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)


Nope from what you posted i guess you were trying to set value to a variable. WHat was the problem you faced? Is it in assigning value to variable or is it in place where you tried to extract value from ntext param?
Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2008-09-15 : 07:30:57
the problem that you get an error which says you can't set an ntext field

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-15 : 12:28:10
quote:
Originally posted by pelegk2

the problem that you get an error which says you can't set an ntext field

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)


can you show query used?
Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2008-09-18 : 09:26:39
yes i wrote it i nthe origianl post

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-18 : 10:23:48
quote:
Originally posted by pelegk2

yes i wrote it i nthe origianl post

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)


you mean @res is a ntext variable? you cant have local varaible of text,ntext or image datatype
Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2008-09-18 : 10:26:45
i nkow i can
so what i did in the decleration variables that the STORED PROCEDURE accepts
i declared the @res ntext=''

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page
   

- Advertisement -